implement teardown
This commit is contained in:
parent
36e89cd148
commit
fbce215f33
|
@ -3,6 +3,7 @@ module Propellor.Property.Systemd (
|
|||
started,
|
||||
stopped,
|
||||
enabled,
|
||||
disabled,
|
||||
persistentJournal,
|
||||
Container,
|
||||
container,
|
||||
|
@ -50,6 +51,11 @@ enabled :: ServiceName -> Property
|
|||
enabled n = trivial $ cmdProperty "systemctl" ["enable", n]
|
||||
`describe` ("service " ++ n ++ " enabled")
|
||||
|
||||
-- | Disables a systemd service.
|
||||
disabled :: ServiceName -> Property
|
||||
disabled n = trivial $ cmdProperty "systemctl" ["distable", n]
|
||||
`describe` ("service " ++ n ++ " disabled")
|
||||
|
||||
-- | Enables persistent storage of the journal.
|
||||
persistentJournal :: Property
|
||||
persistentJournal = check (not <$> doesDirectoryExist dir) $
|
||||
|
@ -124,7 +130,9 @@ nspawnService (Container name _ _) = RevertableProperty setup teardown
|
|||
started service
|
||||
`requires` enabled service
|
||||
|
||||
teardown = undefined
|
||||
teardown = check (doesFileExist servicefile) $
|
||||
disabled service
|
||||
`requires` stopped service
|
||||
|
||||
-- | Installs a "enter-machinename" script that root can use to run a
|
||||
-- command inside the container.
|
||||
|
|
Loading…
Reference in New Issue