-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shutdown conundrum with Plasma #664
Comments
So, actually After=user.slice makes no sense because technically we would have to have user.slice shut down before sddm, albeit for start up we need user.slice to start before sddm (or actually we need systemd-user-sessions and don't care about user.slice at all). Which is something that apparently can't be expressed via systemd, or maybe I am just not finding a config. I am now thinking that this needs to be somewhat more involved. sddm.service should be changed to killmode=mixed which will give sddm itself TERM upon stop but leave the cgroup untouched for starters. Sddm should then block it's own termination until all sddm-started user sessions are fully closed. To that end sddm maybe could send TERM to everything. Alternatively it could simply not do anything but wait, in which case logind would be expected to do the TERM emission, sddm would simply wait for all sessions to close. If sddm's TERM times out, in mixed the entire cgroup will get KILL (that includes Xorg) next, bringing us to the situation we have now. The difference however is that while sddm's TERM was timing out logind would have also sent TERM to the user sessions, so their KILL is imminent anyway, whether or not they get XIOs or whatever from X or an actual KILL from systemd at this point makes no difference anymore. Best case scenario shutdown:
Worst case scenario shutdown (session app is unresponsive to TERM within timeout):
It's still not very elegant but TBH the default expectation here is that desktops actually manage to clean up their session before invoking reboot/poweroff I should think, so what I am suggesting is basically fallback behavior I guess. |
the greeter logins in as sddm - perhaps when the sddm user session will be stopped there be problems there |
@apachelogger before doing something so complex on sddm please try to fix plasma first. |
@apachelogger would xorg with user privileges help here? in that case plasma and sddm would have two different servers |
Hi there, loginctl session-status c1 We have a bug report opened there, seems to be generated by this dbus --autolaunch. https://bugs.mageia.org/show_bug.cgi?id=18942 Cheers. |
Just as a heads-up, this seems to have been fixed by Plasma, in https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1177. |
Plasma systems have problems shutting down properly with system.
This is fairly complicated...
Plasma presently doesn't fully clean up its session (as in: doesn't kill everything before yielding to SDDM or systemd).
Upon logout Plasma returns to sddm, which gets restarted, which implicitly kills most if not everything in standard situations.
BUT on shutdown and reboot Plasma yields to systemd. Systemd then will want to TERM (and later KILL) all user session scopes. This however has a dependency ordering problem with sddm.
sddm.service has
After=systemd-user-sessions.service
this doesn't actually help since the use of this service is "Permit user logins after boot, prohibit user logins at shutdown". It does not actually communicate anything about session state itself.So what happens is:
Now the problem with this is that SDDM shouldn't pull X from under a sessions feet, that is poor dep ordering as it were. The tricky thing is doing this correctly for which there are multiple options:
After=user.slice
to make sure sddm gets ordered after user session killing, I am not sure if this has any adverse effects, but it seems to solve the problemsddm-greater stuck
On my system sddm-greeter actually get stuck in closing (using plasma's breeze theme)
The text was updated successfully, but these errors were encountered: