summaryrefslogtreecommitdiff
path: root/Command/Assistant.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-21 13:23:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-21 13:23:20 -0400
commit5e255e21f93304df5227cdff8a1d13ed3d50f58b (patch)
treed812adc0f0d7087bbacb96a69990b1142ee34848 /Command/Assistant.hs
parentd9f82883aeaacf74011600709fd64b2018d6b1d3 (diff)
assistant --autostart: Automatically ionices the daemons it starts.
Diffstat (limited to 'Command/Assistant.hs')
-rw-r--r--Command/Assistant.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Command/Assistant.hs b/Command/Assistant.hs
index c40c9e5e9..a8928bcf4 100644
--- a/Command/Assistant.hs
+++ b/Command/Assistant.hs
@@ -55,13 +55,16 @@ autoStart = do
f <- autoStartFile
error $ "Nothing listed in " ++ f
program <- readProgramFile
+ haveionice <- inPath "ionice"
forM_ dirs $ \d -> do
putStrLn $ "git-annex autostart in " ++ d
- ifM (catchBoolIO $ go program d)
+ ifM (catchBoolIO $ go haveionice program d)
( putStrLn "ok"
, putStrLn "failed"
)
where
- go program dir = do
+ go haveionice program dir = do
setCurrentDirectory dir
- boolSystem program [Param "assistant"]
+ if haveionice
+ then boolSystem "ionice" [Param "-c3", Param program, Param "assistant"]
+ else boolSystem program [Param "assistant"]