The Stack Overflow podcast is back! Listen to an interview with our new CEO.
2 added 477 characters in body
source | link

As per this answer, I enabled lingering for a user on a headless system. However in loginctl list-sessions, the user is not listed yet. If I login with this user by ssh it is shown, once I disconnect again it is missing.

How can I generate the lingering session without restarting the entire system

I have unsuccessfully tried to systemctl restart systemd-logind.

Edit: My goal is to run a timer controlled by this user. If i try this form a sudo -iu shell after enabling lingering, I get the following error:

$ systemctl --user status servicename
Failed to connect to bus: No such file or directory

If I login per ssh (and a session shows up in loginctl) it works as epxected. But now I noticed it only works within the ssh shell, still not in the sudo shell. So it is in fact probably not related to the session.

As per this answer, I enabled lingering for a user on a headless system. However in loginctl list-sessions, the user is not listed yet. If I login with this user by ssh it is shown, once I disconnect again it is missing.

How can I generate the lingering session without restarting the entire system

I have unsuccessfully tried to systemctl restart systemd-logind.

As per this answer, I enabled lingering for a user on a headless system. However in loginctl list-sessions, the user is not listed yet. If I login with this user by ssh it is shown, once I disconnect again it is missing.

How can I generate the lingering session without restarting the entire system

I have unsuccessfully tried to systemctl restart systemd-logind.

Edit: My goal is to run a timer controlled by this user. If i try this form a sudo -iu shell after enabling lingering, I get the following error:

$ systemctl --user status servicename
Failed to connect to bus: No such file or directory

If I login per ssh (and a session shows up in loginctl) it works as epxected. But now I noticed it only works within the ssh shell, still not in the sudo shell. So it is in fact probably not related to the session.

1
source | link

How to apply lingering immedeately

As per this answer, I enabled lingering for a user on a headless system. However in loginctl list-sessions, the user is not listed yet. If I login with this user by ssh it is shown, once I disconnect again it is missing.

How can I generate the lingering session without restarting the entire system

I have unsuccessfully tried to systemctl restart systemd-logind.