Chris Green wrote:
> This is more out of interest than necessity but I'd like to know where
> systemd-logind.service stores its persistent data. E.g. in particular
> when I run 'loginctl enaable-linger chris' where is the required flag
> set?
>
> It must be a persistent location as 'enable-linger' obviously survives
> a reboot, but I just can't find where it is.
>
> There is a sort of reason for wanting to know this, I want to backup
> the information so that if/when I rebuild a system it doesn't get
> lost. At present I just have a note to myself in my configuration
> repository that 'loginctl enable-linger chris' needs to be run on a
> couple of systems but it would be nicer if I could automate it.
AFAIK it simply touches /var/lib/systemd/linger/$USER:
[test@trixie ~]$ loginctl show-user "$USER" --property=Linger
Linger=no
[test@trixie ~]$ ls /var/lib/systemd/linger/
[test@trixie ~]$
[test@trixie ~]$ loginctl enable-linger
[test@trixie ~]$ loginctl show-user "$USER" --property=Linger
Linger=yes
[test@trixie ~]$ ls /var/lib/systemd/linger/
test
[test@trixie ~]$ loginctl disable-linger
[test@trixie ~]$ loginctl show-user "$USER" --property=Linger
Linger=no
[test@trixie ~]$ ls /var/lib/systemd/linger/
[test@trixie ~]$
--
Todd
Attachment:
signature.asc
Description: PGP signature