GDM relogin: stop GDM while the old user manager shuts down
Sync git.upriser.nl mirror / sync (push) Skipped

This commit is contained in:
theupriser committed 2026-10-14 13:45:03 +02:00
1 parent 66a9d33210
commit f2b5f84526
1 file changed
+6 -3
+6 -3
View File
@@ -11,7 +11,10 @@ if [[ "$1" != --work ]]; then
exec systemd-run --no-block --collect --unit=steamify-gdm-relogin "$0" --work "$SUDO_USER" exec systemd-run --no-block --collect --unit=steamify-gdm-relogin "$0" --work "$SUDO_USER"
fi fi
USER_NAME="$2" USER_NAME="$2"
# No waiting for the old user manager to go: systemd starts the new login # GDM is stopped first, so its login screen doesn't show while the old user
# after it, and waiting only keeps GDM's login screen up in the meantime. # manager shuts down; a new login right away fails ("A graphical session is
# already running!", or the session dies at once), so wait until it is gone.
systemctl stop gdm.service
loginctl terminate-user "$USER_NAME" loginctl terminate-user "$USER_NAME"
systemctl restart gdm.service for _ in $(seq 120); do loginctl show-user "$USER_NAME" >/dev/null 2>&1 || break; sleep 0.25; done
systemctl start gdm.service