diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-01 14:11:36 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-01 14:11:36 -0400 |
| commit | 5422a5b3764855bb1109648fb401a9b15bf2919c (patch) | |
| tree | 31560ba8852247995e4faf5227352b507e2e683f | |
| parent | 407f1b27fcf619b79b30ba89252f5a16df00f27f (diff) | |
nochange on service
| -rw-r--r-- | Propellor/Property/Cmd.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Propellor/Property/Cmd.hs b/Propellor/Property/Cmd.hs index 09db6500..b1c9435a 100644 --- a/Propellor/Property/Cmd.hs +++ b/Propellor/Property/Cmd.hs @@ -5,10 +5,12 @@ module Propellor.Property.Cmd ( serviceRunning, ) where +import Control.Monad import Control.Applicative import Data.List import Propellor.Types +import Propellor.Engine import Utility.Monad import Utility.SafeCommand import Utility.Env @@ -43,6 +45,7 @@ scriptProperty script = cmdProperty "sh" ["-c", shellcmd] -- we can do is try to start the service, and if it fails, assume -- this means it's already running. serviceRunning :: String -> Property -serviceRunning svc = scriptProperty - ["service " ++ shellEscape svc ++ " start >/dev/null 2>&1 || true"] - `describe` ("running " ++ svc) +serviceRunning svc = Property ("running " ++ svc) $ do + void $ ensureProperty $ + scriptProperty ["service " ++ shellEscape svc ++ " start >/dev/null 2>&1 || true"] + return NoChange |
