summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Systemd.hs
diff options
context:
space:
mode:
authorJoey Hess2015-07-05 15:52:46 -0400
committerJoey Hess2015-07-05 15:52:46 -0400
commit0349cf076b66fcdd13213e52cca51464c9654594 (patch)
tree4131f59236bbfe363d4463565530ce7d5b1c7588 /src/Propellor/Property/Systemd.hs
parentd4c72ac439ded9f4abf28c20d04e27575b183aca (diff)
parent71265a2d6f8ba2071504c45c938a65c0f3cc1546 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Systemd.hs')
-rw-r--r--src/Propellor/Property/Systemd.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index 17849980..718ceca6 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -7,6 +7,7 @@ module Propellor.Property.Systemd (
stopped,
enabled,
disabled,
+ masked,
running,
restarted,
networkd,
@@ -89,6 +90,15 @@ disabled :: ServiceName -> Property NoInfo
disabled n = trivial $ cmdProperty "systemctl" ["disable", n]
`describe` ("service " ++ n ++ " disabled")
+-- | Masks a systemd service.
+masked :: ServiceName -> RevertableProperty
+masked n = systemdMask <!> systemdUnmask
+ where
+ systemdMask = trivial $ cmdProperty "systemctl" ["mask", n]
+ `describe` ("service " ++ n ++ " masked")
+ systemdUnmask = trivial $ cmdProperty "systemctl" ["unmask", n]
+ `describe` ("service " ++ n ++ " unmasked")
+
-- | Ensures that a service is both enabled and started
running :: ServiceName -> Property NoInfo
running n = trivial $ started n `requires` enabled n