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
|
@ -40,6 +40,8 @@ bundledPrograms = catMaybes
|
||||||
, SysConfig.sha512
|
, SysConfig.sha512
|
||||||
, SysConfig.sha224
|
, SysConfig.sha224
|
||||||
, SysConfig.sha384
|
, SysConfig.sha384
|
||||||
|
-- ionice is not included in the bundle; we rely on the system's
|
||||||
|
-- own version, which may better match its kernel
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
ifset True s = Just s
|
ifset True s = Just s
|
||||||
|
|
|
@ -31,6 +31,7 @@ tests =
|
||||||
, TestCase "curl" $ testCmd "curl" "curl --version >/dev/null"
|
, TestCase "curl" $ testCmd "curl" "curl --version >/dev/null"
|
||||||
, TestCase "wget" $ testCmd "wget" "wget --version >/dev/null"
|
, TestCase "wget" $ testCmd "wget" "wget --version >/dev/null"
|
||||||
, TestCase "bup" $ testCmd "bup" "bup --version >/dev/null"
|
, TestCase "bup" $ testCmd "bup" "bup --version >/dev/null"
|
||||||
|
, TestCase "ionice" $ testCmd "ionice" "ionice --version >/dev/null"
|
||||||
, TestCase "gpg" $ maybeSelectCmd "gpg"
|
, TestCase "gpg" $ maybeSelectCmd "gpg"
|
||||||
[ ("gpg", "--version >/dev/null")
|
[ ("gpg", "--version >/dev/null")
|
||||||
, ("gpg2", "--version >/dev/null") ]
|
, ("gpg2", "--version >/dev/null") ]
|
||||||
|
|
|
@ -55,13 +55,16 @@ autoStart = do
|
||||||
f <- autoStartFile
|
f <- autoStartFile
|
||||||
error $ "Nothing listed in " ++ f
|
error $ "Nothing listed in " ++ f
|
||||||
program <- readProgramFile
|
program <- readProgramFile
|
||||||
|
haveionice <- inPath "ionice"
|
||||||
forM_ dirs $ \d -> do
|
forM_ dirs $ \d -> do
|
||||||
putStrLn $ "git-annex autostart in " ++ d
|
putStrLn $ "git-annex autostart in " ++ d
|
||||||
ifM (catchBoolIO $ go program d)
|
ifM (catchBoolIO $ go haveionice program d)
|
||||||
( putStrLn "ok"
|
( putStrLn "ok"
|
||||||
, putStrLn "failed"
|
, putStrLn "failed"
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
go program dir = do
|
go haveionice program dir = do
|
||||||
setCurrentDirectory dir
|
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
6
debian/changelog
vendored
|
@ -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
|
git-annex (4.20130621) unstable; urgency=low
|
||||||
|
|
||||||
* Supports indirect mode on encfs in paranoia mode, and other
|
* Supports indirect mode on encfs in paranoia mode, and other
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue