From 99b407b895d3e9815193d7d4a43bd4bd3a15ccf9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 15:52:27 -0400 Subject: propellor spin --- debian/changelog | 1 + propellor.cabal | 1 + src/Utility/Directory.hs | 6 +++--- src/Utility/SystemDirectory.hs | 16 ++++++++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/Utility/SystemDirectory.hs diff --git a/debian/changelog b/debian/changelog index 2092e784..137d9d75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ propellor (3.0.4) UNRELEASED; urgency=medium Thanks, davean. * Module added for the Borg backup system. Thanks, FĂ©lix Sipma. + * Fix build with directory-1.2.6.2. -- Joey Hess Thu, 05 May 2016 10:37:43 -0400 diff --git a/propellor.cabal b/propellor.cabal index beac5c38..547f34a6 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -207,6 +207,7 @@ Library Utility.Process.NonConcurrent Utility.SafeCommand Utility.Scheduled + Utility.SystemDirectory Utility.Table Utility.ThreadScheduler Utility.Tmp diff --git a/src/Utility/Directory.hs b/src/Utility/Directory.hs index 3b12b9fc..693e7713 100644 --- a/src/Utility/Directory.hs +++ b/src/Utility/Directory.hs @@ -6,15 +6,14 @@ -} {-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -fno-warn-tabs -w #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} module Utility.Directory ( module Utility.Directory, - module System.Directory + module Utility.SystemDirectory ) where import System.IO.Error -import System.Directory hiding (isSymbolicLink) import Control.Monad import System.FilePath import Control.Applicative @@ -31,6 +30,7 @@ import Utility.SafeCommand import Control.Monad.IfElse #endif +import Utility.SystemDirectory import Utility.PosixFiles import Utility.Tmp import Utility.Exception diff --git a/src/Utility/SystemDirectory.hs b/src/Utility/SystemDirectory.hs new file mode 100644 index 00000000..3dd44d19 --- /dev/null +++ b/src/Utility/SystemDirectory.hs @@ -0,0 +1,16 @@ +{- System.Directory without its conflicting isSymbolicLink + - + - Copyright 2016 Joey Hess + - + - License: BSD-2-clause + -} + +-- Disable warnings because only some versions of System.Directory export +-- isSymbolicLink. +{-# OPTIONS_GHC -fno-warn-tabs -w #-} + +module Utility.SystemDirectory ( + module System.Directory +) where + +import System.Directory hiding (isSymbolicLink) -- cgit v1.2.3 From dfd567ec3e71d68bba974c23dd4ae27fed37ec0f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 23 May 2016 11:25:41 -0400 Subject: setting up joeyconfig after merge --- config.hs | 2 +- privdata/relocate | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index ec313725..97d90636 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -config-simple.hs \ No newline at end of file +joeyconfig.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate new file mode 100644 index 00000000..271692d8 --- /dev/null +++ b/privdata/relocate @@ -0,0 +1 @@ +.joeyconfig -- cgit v1.2.3 From a52f7a546def6685be8dba5d7145b1f50aaa35d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 28 May 2016 14:48:59 -0400 Subject: deal with systemd's KillUserProcesses change * Systemd: Added killUserProcesses property, which can be reverted to return systemd to its default behavior before version 230 started killing processes like screen sessions. * Systemd: Added logindConfigured property. --- debian/changelog | 4 ++++ joeyconfig.hs | 3 +++ src/Propellor/Property/Systemd.hs | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/debian/changelog b/debian/changelog index 02bf0d1e..0f85ccf0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ propellor (3.0.5) UNRELEASED; urgency=medium * Modules added for Sbuild and Ccache. Thanks, Sean Whitton + * Systemd: Added killUserProcesses property, which can be reverted + to return systemd to its default behavior before version 230 started + killing processes like screen sessions. + * Systemd: Added logindConfigured property. -- Joey Hess Mon, 23 May 2016 11:19:28 -0400 diff --git a/joeyconfig.hs b/joeyconfig.hs index 20103e61..98c565c5 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -564,6 +564,9 @@ standardSystemUnhardened suite arch motd = propertyList "standard system" $ prop -- I use postfix, or no MTA. & Apt.removed ["exim4", "exim4-daemon-light", "exim4-config", "exim4-base"] `onChange` Apt.autoRemove + -- At least until system integration catches up, revert + -- systemd 230's behavior of enabling this property by default. + ! Systemd.killUserProcesses -- This is my standard container setup, Featuring automatic upgrades. standardContainer :: DebianSuite -> Property (HasInfo + Debian) 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 -> -- cgit v1.2.3