From f2b5f84526d2564b455257b21f6a4ec1eb466be1 Mon Sep 17 00:00:00 2001 From: theupriser Date: Wed, 14 Oct 2026 13:45:03 +0200 Subject: [PATCH] GDM relogin: stop GDM while the old user manager shuts down --- patches/steamify-gdm-relogin.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/steamify-gdm-relogin.sh b/patches/steamify-gdm-relogin.sh index 294a350..dde6b97 100644 --- a/patches/steamify-gdm-relogin.sh +++ b/patches/steamify-gdm-relogin.sh @@ -11,7 +11,10 @@ if [[ "$1" != --work ]]; then exec systemd-run --no-block --collect --unit=steamify-gdm-relogin "$0" --work "$SUDO_USER" fi USER_NAME="$2" -# No waiting for the old user manager to go: systemd starts the new login -# after it, and waiting only keeps GDM's login screen up in the meantime. +# GDM is stopped first, so its login screen doesn't show while the old user +# 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" -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