assistant --autostart: Automatically ionices the daemons it starts.

This commit is contained in:
Joey Hess 2013-06-21 13:23:20 -04:00
parent b9448c31a3
commit d901ba1781
4 changed files with 15 additions and 3 deletions

View file

@ -40,6 +40,8 @@ bundledPrograms = catMaybes
, SysConfig.sha512
, SysConfig.sha224
, SysConfig.sha384
-- ionice is not included in the bundle; we rely on the system's
-- own version, which may better match its kernel
]
where
ifset True s = Just s

View file

@ -31,6 +31,7 @@ tests =
, TestCase "curl" $ testCmd "curl" "curl --version >/dev/null"
, TestCase "wget" $ testCmd "wget" "wget --version >/dev/null"
, TestCase "bup" $ testCmd "bup" "bup --version >/dev/null"
, TestCase "ionice" $ testCmd "ionice" "ionice --version >/dev/null"
, TestCase "gpg" $ maybeSelectCmd "gpg"
[ ("gpg", "--version >/dev/null")
, ("gpg2", "--version >/dev/null") ]

View file

@ -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"]

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
git-annex (4.20130622) UNRELEASED; urgency=low
* assistant --autostart: Automatically ionices the daemons it starts.
-- Joey Hess <joeyh@debian.org> Fri, 21 Jun 2013 13:16:17 -0400
git-annex (4.20130621) unstable; urgency=low
* Supports indirect mode on encfs in paranoia mode, and other