summaryrefslogtreecommitdiff
path: root/Propellor/Property/Cmd.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-08 19:31:03 -0400
committerJoey Hess2014-04-08 19:31:03 -0400
commita52a2a89dfe92d7bed4a6446101657a288fd3bae (patch)
tree207f98df36a858276269dcf87926566ea082018b /Propellor/Property/Cmd.hs
parent7561ee0443a33ffc0574dc6b606c9128da3fba4f (diff)
serviceInstalledRunning
Diffstat (limited to 'Propellor/Property/Cmd.hs')
-rw-r--r--Propellor/Property/Cmd.hs23
1 files changed, 0 insertions, 23 deletions
diff --git a/Propellor/Property/Cmd.hs b/Propellor/Property/Cmd.hs
index f661cf81..c715fd2a 100644
--- a/Propellor/Property/Cmd.hs
+++ b/Propellor/Property/Cmd.hs
@@ -3,16 +3,12 @@ module Propellor.Property.Cmd (
cmdProperty',
scriptProperty,
userScriptProperty,
- serviceRunning,
- serviceRestarted,
) 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
@@ -47,22 +43,3 @@ userScriptProperty :: UserName -> [String] -> Property
userScriptProperty user script = cmdProperty "su" ["-c", shellcmd, user]
where
shellcmd = intercalate " ; " ("set -e" : "cd" : script)
-
-type ServiceName = String
-
--- | Ensures that a service is running.
---
--- Note that due to the general poor state of init scripts, the best
--- we can do is try to start the service, and if it fails, assume
--- this means it's already running.
-serviceRunning :: ServiceName -> Property
-serviceRunning svc = Property ("running " ++ svc) $ do
- void $ ensureProperty $
- scriptProperty ["service " ++ shellEscape svc ++ " start >/dev/null 2>&1 || true"]
- return NoChange
-
-serviceRestarted :: ServiceName -> Property
-serviceRestarted svc = Property ("restarted " ++ svc) $ do
- void $ ensureProperty $
- scriptProperty ["service " ++ shellEscape svc ++ " restart >/dev/null 2>&1 || true"]
- return NoChange