Systemd.masked property
This property masks, and when reverted unmasks, systemd services. This is just `systemctl mask service` and `systemctl unmask service`. It's useful for turning off a system service that you intend to run with --user. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
This commit is contained in:
parent
1d6972bb79
commit
b462aefdb2
|
@ -7,6 +7,7 @@ module Propellor.Property.Systemd (
|
||||||
stopped,
|
stopped,
|
||||||
enabled,
|
enabled,
|
||||||
disabled,
|
disabled,
|
||||||
|
masked,
|
||||||
running,
|
running,
|
||||||
restarted,
|
restarted,
|
||||||
networkd,
|
networkd,
|
||||||
|
@ -89,6 +90,15 @@ disabled :: ServiceName -> Property NoInfo
|
||||||
disabled n = trivial $ cmdProperty "systemctl" ["disable", n]
|
disabled n = trivial $ cmdProperty "systemctl" ["disable", n]
|
||||||
`describe` ("service " ++ n ++ " disabled")
|
`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
|
-- | Ensures that a service is both enabled and started
|
||||||
running :: ServiceName -> Property NoInfo
|
running :: ServiceName -> Property NoInfo
|
||||||
running n = trivial $ started n `requires` enabled n
|
running n = trivial $ started n `requires` enabled n
|
||||||
|
|
Loading…
Reference in New Issue