summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Cron.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/Cron.hs')
-rw-r--r--src/Propellor/Property/Cron.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Propellor/Property/Cron.hs b/src/Propellor/Property/Cron.hs
index 737c144f..25540fae 100644
--- a/src/Propellor/Property/Cron.hs
+++ b/src/Propellor/Property/Cron.hs
@@ -87,12 +87,15 @@ niceJob desc times user cddir command = job desc times user cddir
("nice ionice -c 3 sh -c " ++ shellEscape command)
-- | Installs a cron job to run propellor.
-runPropellor :: Times -> Property DebianLike
-runPropellor times = withOS "propellor cron job" $ \w o -> do
- bootstrapper <- getBootstrapper
- ensureProperty w $
- niceJob "propellor" times (User "root") localdir
- (bootstrapPropellorCommand bootstrapper o ++ "; ./propellor")
+runPropellor :: Times -> RevertableProperty DebianLike UnixLike
+runPropellor times = cronned <!> uncronned
+ where
+ cronned = withOS "propellor cron job" $ \w o -> do
+ bootstrapper <- getBootstrapper
+ ensureProperty w $
+ niceJob "propellor" times (User "root") localdir
+ (bootstrapPropellorCommand bootstrapper o ++ "; ./propellor")
+ uncronned = jobDropped "propellor" times
-- Utility functions