canonical / lightdm

Display Manager
GNU General Public License v3.0
824 stars 138 forks source link

LightDM doesn't close session on logout, leaving user services running #45

Open alkisg opened 5 years ago

alkisg commented 5 years ago

This happens in many distributions and in many desktop environments. If you login using lightdm and then logout:

The correct thing to do would be for LightDM to close the PAM session so that systemd then stops all those services. Otherwise problems like "could not acquire bus sesson" are caused on re-logins and I've even seen dconf database corruption in 2 cases, which may be related.

Tested in: Ubuntu MATE 18.04.1, Debian Stretch, lubuntu-18.04.1-desktop-i386.iso, xubuntu-18.04.1-desktop-i386.iso, Fedora-MATE_Compiz-Live-x86_64-28-1.1.iso

To reproduce just boot into any live CD or distro that uses lightdm, logout, switch to vt2, login, run ps -ef and see that the user services are still running even hours later.

This doesn't happen in Ubuntu 16.04.5, so it might be a regression. And of course if one replaces lightdm with gdm, it doesn't happen in any of the above test cases either.

khurshid-alam commented 5 years ago

Not a lightdm issue. It's a session manager's job. They are running because session manager specifically asks them to be running. But the whole thing is more complex. Processes like like tmux, screen are supposed to be running.

Systemd: https://github.com/systemd/systemd/commit/97e5530cf2

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825394 & https://github.com/tmux/tmux/issues/428

lukefromdc commented 5 years ago

Lightdm in general is starting to get buggy. Debian Unstable just sent an update in some other package that caused sessions started from second or subsequent logins (first login is an autologin on my system as I use full disk encryption) to crash back to the greeter. Only workaround was to stop and restart lightdm from the console via systemd. Last night's updates (possibly to Xorg?) fixed this. Wonder if this is related?

vkareh commented 5 years ago

Just to mention, we've just merged a fix for MATE's session manager that addresses this: https://github.com/mate-desktop/mate-session-manager/pull/184 Not sure what other desktop environments you've tested with, but this seems to be addressed in MATE at least.

alkisg commented 5 years ago

Hi vkareh, yeah I was the one that reported https://github.com/mate-desktop/mate-session-manager/issues/165, which you closed by https://github.com/mate-desktop/mate-session-manager/pull/184.

Thank you very much for your work on this! Let's hope wimpress can backport it to the current Ubuntu LTS release.