You are not logged in.

#1 2023-06-27 19:31:03

LRitzdorf
Member
Registered: 2022-12-08
Posts: 35

Using loginctl terminate-session to log out: nonstandard?

[Continuing from https://bbs.archlinux.org/viewtopic.php … #p2106594]

On my system, using i3 and sddm, I recently switched to a Rofi-based power menu that uses "loginctl terminate-session" as its logout command. This causes i3 (and, as evidenced by later testing, Awesome and Openbox as well) to exit with nonzero status, leaving behind the desktop wallpaper and movable cursor, but nothing else. "Zapping" the X server via Ctrl+Alt+Bksp succeeds in bringing back sddm, however. (The usual "i3-msg exit" continues to work as expected.)

Is "loginctl terminate-session" actually a standard way of logging out a graphical session? If so, would handling post-exit cleanup for this be the job of sddm, or of the window manager?

Relevant journal entries from sddm.service:

[normal authentication messages...]
Jun 27 10:28:27 ritzcracker sddm[1447]: Authentication for user  "lucas"  successful
Jun 27 10:28:27 ritzcracker sddm-helper[2889]: pam_unix(sddm:session): session opened for user lucas(uid=1000) by lucas(uid=0)
Jun 27 10:28:28 ritzcracker sddm[1447]: Auth: sddm-helper exited successfully
Jun 27 10:28:28 ritzcracker sddm[1447]: Greeter stopped. SDDM::Auth::HELPER_SUCCESS
Jun 27 10:28:28 ritzcracker sddm-helper[2889]: gkr-pam: unlocked login keyring
Jun 27 10:28:28 ritzcracker sddm-helper[2889]: Writing cookie to "/tmp/xauth_mFtYQi"
Jun 27 10:28:28 ritzcracker sddm-helper[2889]: Starting X11 session: "" "/usr/share/sddm/scripts/Xsession \"i3\""
Jun 27 10:28:28 ritzcracker sddm[1447]: Session started true
Jun 27 10:41:00 ritzcracker sddm[1447]: Authentication error: SDDM::Auth::ERROR_INTERNAL "Process crashed"
Jun 27 10:41:00 ritzcracker sddm[1447]: Auth: sddm-helper (--socket /tmp/sddm-auth-adf3ee76-edf8-477e-afa6-7eeb161f3a9b --id 1 --start i3 --user lucas) crashed (exit code 1)
Jun 27 10:41:00 ritzcracker sddm[1447]: Authentication error: SDDM::Auth::ERROR_INTERNAL "Process crashed"
Jun 27 10:41:00 ritzcracker sddm[1447]: Auth: sddm-helper exited with 1
Jun 27 10:41:05 ritzcracker sddm[1447]: Display server stopped.
[further stopping-server messages...]

In the above log, "loginctl terminate-session" was issued at 10:41:00, and the X server was zapped at 10:41:05.

Last edited by LRitzdorf (2023-06-27 19:33:05)

Offline

#2 2023-06-28 05:39:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,691

Re: Using loginctl terminate-session to log out: nonstandard?

Relevant journal entries from sddm.service:

Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'f:1=<-' ix.io

terminate-session kills all session processes, this might include the sddm-helper and that might make it think that it crashed - or i3 crashes because some other process terminated. Or something else.
Also have a look whether https://wiki.archlinux.org/title/Core_d … _core_dump has some interesting entries.

Is "loginctl terminate-session" actually a standard way of logging out a graphical session?

I doubt there's a "standard" but ideally one SHOULD just seek an orderly shutdown, ie. sigterm all of the session processes to give them at least a chance to shutdown orderly before terminating the session-keeping process (as this will withdraw the display server from the remaining processes what for most clients/toolkits leads to them wetting themselves)
Unfortunately that's usually not the case and the session is terminated by killing the session keeping process ("i3-msg exit")

Offline

#3 2023-06-28 06:04:57

LRitzdorf
Member
Registered: 2022-12-08
Posts: 35

Re: Using loginctl terminate-session to log out: nonstandard?

All right, thanks for the clarification! It's very straightforward to change the command that Rofi Power Menu uses to log out, and I plan to stay with i3 for the (forseeable) future, so I'll just use "i3-msg exit" there instead of "loginctl terminate-session". If i3 isn't expected to handle being terminated in that way, I'm happy to work around it.

Thanks again for the tips!

Offline

#4 2023-06-28 06:08:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,691

Re: Using loginctl terminate-session to log out: nonstandard?

If i3 isn't expected to handle being terminated in that way

Awesome and Openbox as well

might include the sddm-helper and that might make it think that it crashed

You'll have to look at least at the full journal to get a grasp on the order of events.

Offline

Board footer

Powered by FluxBB