nochange on service
This commit is contained in:
parent
407f1b27fc
commit
5422a5b376
|
@ -5,10 +5,12 @@ module Propellor.Property.Cmd (
|
||||||
serviceRunning,
|
serviceRunning,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Control.Monad
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
import Data.List
|
import Data.List
|
||||||
|
|
||||||
import Propellor.Types
|
import Propellor.Types
|
||||||
|
import Propellor.Engine
|
||||||
import Utility.Monad
|
import Utility.Monad
|
||||||
import Utility.SafeCommand
|
import Utility.SafeCommand
|
||||||
import Utility.Env
|
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
|
-- we can do is try to start the service, and if it fails, assume
|
||||||
-- this means it's already running.
|
-- this means it's already running.
|
||||||
serviceRunning :: String -> Property
|
serviceRunning :: String -> Property
|
||||||
serviceRunning svc = scriptProperty
|
serviceRunning svc = Property ("running " ++ svc) $ do
|
||||||
["service " ++ shellEscape svc ++ " start >/dev/null 2>&1 || true"]
|
void $ ensureProperty $
|
||||||
`describe` ("running " ++ svc)
|
scriptProperty ["service " ++ shellEscape svc ++ " start >/dev/null 2>&1 || true"]
|
||||||
|
return NoChange
|
||||||
|
|
Loading…
Reference in New Issue