aboutsummaryrefslogtreecommitdiff
path: root/src/property/systemd.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-09-18 15:07:32 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-09-18 15:07:32 -0700
commit68c004307a4da7fc4768072ab05dd55ac4abd888 (patch)
tree86eccde7229109b3bd65625c5b767eea7fae3c93 /src/property/systemd.lisp
parent05531865dd9de53901cfa41917a8da4c13e2a303 (diff)
downloadconsfigurator-68c004307a4da7fc4768072ab05dd55ac4abd888.tar.gz
add SYSTEMD:LINGERING-ENABLED
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/systemd.lisp')
-rw-r--r--src/property/systemd.lisp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/property/systemd.lisp b/src/property/systemd.lisp
index b38ed5d..a83f206 100644
--- a/src/property/systemd.lisp
+++ b/src/property/systemd.lisp
@@ -50,3 +50,9 @@
(run :may-fail "systemctl" "is-enabled" service)))
(:apply (mrun "systemctl" "mask" service))
(:unapply (mrun "systemctl" "unmask" service)))
+
+(defprop lingering-enabled :posix (user)
+ (:desc #?"User lingering enable for ${user}")
+ (:check (memstring= "Linger=yes" (runlines "loginctl" "show-user" user)))
+ (:apply (mrun "loginctl" "enable-linger" user))
+ (:unapply (mrun "loginctl" "disable-linger" user)))