diff options
author | Joey Hess <joey@kitenet.net> | 2013-06-21 13:23:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-06-21 13:23:20 -0400 |
commit | 5e255e21f93304df5227cdff8a1d13ed3d50f58b (patch) | |
tree | d812adc0f0d7087bbacb96a69990b1142ee34848 | |
parent | d9f82883aeaacf74011600709fd64b2018d6b1d3 (diff) |
assistant --autostart: Automatically ionices the daemons it starts.
-rw-r--r-- | Build/BundledPrograms.hs | 2 | ||||
-rw-r--r-- | Build/Configure.hs | 1 | ||||
-rw-r--r-- | Command/Assistant.hs | 9 | ||||
-rw-r--r-- | debian/changelog | 6 |
4 files changed, 15 insertions, 3 deletions
diff --git a/Build/BundledPrograms.hs b/Build/BundledPrograms.hs index ae4beedf7..9a50778d4 100644 --- a/Build/BundledPrograms.hs +++ b/Build/BundledPrograms.hs @@ -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 diff --git a/Build/Configure.hs b/Build/Configure.hs index 399af9da8..e32017ec3 100644 --- a/Build/Configure.hs +++ b/Build/Configure.hs @@ -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") ] 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"] diff --git a/debian/changelog b/debian/changelog index 887ecadec..732222f90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 |