summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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