diff options
Diffstat (limited to 'src/Propellor')
| -rw-r--r-- | src/Propellor/Property/Systemd.hs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index e5441817..e11c991e 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -12,6 +12,7 @@ module Propellor.Property.Systemd ( restarted, networkd, journald, + logind, -- * Configuration installed, Option, @@ -20,6 +21,9 @@ module Propellor.Property.Systemd ( -- * Journal persistentJournal, journaldConfigured, + -- * Logind + logindConfigured, + killUserProcesses, -- * Containers and machined machined, MachineName, @@ -127,6 +131,10 @@ networkd = "systemd-networkd" journald :: ServiceName journald = "systemd-journald" +-- | The systemd-logind service. +logind :: ServiceName +logind = "systemd-logind" + -- | Enables persistent storage of the journal. persistentJournal :: Property DebianLike persistentJournal = check (not <$> doesDirectoryExist dir) $ @@ -172,6 +180,25 @@ journaldConfigured option value = configured "/etc/systemd/journald.conf" option value `onChange` restarted journald +-- | Configures logind, restarting it so the changes take effect. +logindConfigured :: Option -> String -> Property Linux +logindConfigured option value = + configured "/etc/systemd/logind.conf" option value + `onChange` restarted logind + +-- | Configures whether leftover processes started from the +-- user's login session are killed after the user logs out. +-- +-- The default configuration varies depending on the version of systemd. +-- +-- Revert the property to ensure that screen sessions etc keep running: +-- +-- > ! killUserProcesses +killUserProcesses :: RevertableProperty Linux Linux +killUserProcesses = set "yes" <!> set "no" + where + set = logindConfigured "KillUserProcesses" + -- | Ensures machined and machinectl are installed machined :: Property Linux machined = withOS "machined installed" $ \w o -> |
