make a dsa_systemd::linger to enable or disable lingering consistently
[mirror/dsa-puppet.git] / modules / dsa_systemd / manifests / init.pp
index 5fff2c1..2e09b06 100644 (file)
@@ -27,4 +27,15 @@ class dsa_systemd {
                                */10 * * * * root /usr/local/sbin/systemd-cleanup-failed
                                | EOF
        }
+
+       # systemd bug on buster, maybe related to https://github.com/systemd/systemd/issues/12401
+       # | root@onionoo-backend-01:~# loginctl enable-linger onionoo
+       # | Could not enable linger: No such file or directory
+       # Having the /var/lib/systemd/linger directory exist already enables
+       # us to just define file resources in dsa_systemd::linger.  That won't
+       # start the user session immediately, but it'll work after a reboot
+       file { '/var/lib/systemd/linger':
+               mode   => '0755',
+               ensure => 'directory',
+       }
 }