diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-21 14:37:19 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-21 14:37:19 -0400 |
| commit | fbce215f3381b36df64c0e268bb816b1b0a4fd0d (patch) | |
| tree | 6952cc9705bc2facb069ff30d853399493f4c9b1 /src | |
| parent | 36e89cd148cd266254f4c50c5396d05433ed9bb3 (diff) | |
implement teardown
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Systemd.hs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index c6f57e23..ce7d63c1 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -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) $ @@ -121,10 +127,12 @@ nspawnService (Container name _ _) = RevertableProperty setup teardown servicefile = "/etc/systemd/system/multi-user.target.wants" </> service setup = check (not <$> doesFileExist servicefile) $ - started service - `requires` enabled service + 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. |
