assistant --autostart: Automatically ionices the daemons it starts.
This commit is contained in:
parent
b9448c31a3
commit
d901ba1781
4 changed files with 15 additions and 3 deletions
|
@ -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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue