diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-17 21:01:06 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-17 21:01:06 -0400 |
| commit | 0485387aa03f2e81c218fe689cb6a9a5a8fe14a4 (patch) | |
| tree | 95943cf270640097727af877f3933b940af60db3 | |
| parent | c4f02f0bc89aa508c314d0577e85e79ce56a69ac (diff) | |
Run all cron jobs under chronic from moreutils to avoid unnecessary mails.
| -rw-r--r-- | Propellor/Property/Cron.hs | 8 | ||||
| -rw-r--r-- | debian/changelog | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Propellor/Property/Cron.hs b/Propellor/Property/Cron.hs index 71580bc3..0649ee9f 100644 --- a/Propellor/Property/Cron.hs +++ b/Propellor/Property/Cron.hs @@ -16,6 +16,8 @@ type CronTimes = String -- Only one instance of the cron job is allowed to run at a time, no matter -- how long it runs. This is accomplished using flock locking of the cron -- job file. +-- +-- The cron job's output will only be emailed if it exits nonzero. job :: Desc -> CronTimes -> UserName -> FilePath -> String -> Property job desc times user cddir command = cronjobfile `File.hasContent` [ "# Generated by propellor" @@ -24,10 +26,11 @@ job desc times user cddir command = cronjobfile `File.hasContent` , "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" , "" , times ++ "\t" ++ user ++ "\t" - ++ "flock -n " ++ shellEscape cronjobfile + ++ "chronic flock -n " ++ shellEscape cronjobfile ++ " sh -c " ++ shellEscape cmdline ] `requires` Apt.serviceInstalledRunning "cron" + `requires` Apt.installed ["util-linux", "moreutils"] `describe` ("cronned " ++ desc) where cmdline = "cd " ++ cddir ++ " && " ++ command @@ -40,8 +43,7 @@ job desc times user cddir command = cronjobfile `File.hasContent` niceJob :: Desc -> CronTimes -> UserName -> FilePath -> String -> Property niceJob desc times user cddir command = job desc times user cddir ("nice ionice -c 3 " ++ command) - `requires` Apt.installed ["util-linux", "moreutils"] -- | Installs a cron job to run propellor. runPropellor :: CronTimes -> Property -runPropellor times = niceJob "propellor" times "root" localdir "chronic make" +runPropellor times = niceJob "propellor" times "root" localdir "make" diff --git a/debian/changelog b/debian/changelog index 41e6fe55..3daeb395 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (0.3.2) UNRELEASED; urgency=medium + + * Run all cron jobs under chronic from moreutils to avoid unnecessary mails. + + -- Joey Hess <joeyh@debian.org> Thu, 17 Apr 2014 21:00:43 -0400 + propellor (0.3.1) unstable; urgency=medium * Merge scheduler bug fix from git-annex. |
