Hi, I noticed an issue after upgrading to 26.05:
If I exit from Sway, and try to log back in with Gnome, Gnome refuses to start, dropping me back immediately to the login screen.
journalctl shows .gnome-session complaining about “A graphical session is already running!”. Indeed, if I run systemctl –user stop sway-session.target in a TTY, then I can login into Gnome just fine.
I checked on another old systems that I haven’t yet upgraded to 26.05, and I noticed that the stale session was there as well, when exiting from Sway, so I think what changed in 26.05 is Gnome being less lenient when a session is already running.
/etc/sway/config.d/nixos.conf contains a command that is meant to cleanup the session. I tested the swaymsg -t subscribe on its own, and I confirmed:
- it works with a
windowevent - it fails with a
shutdownevent with[ERROR] [common/ipc-client.c:86] Unable to receive IPC responseand never successfully receives the event
I reported this issue on the sway bug tracker, but I’m writing this here to let Nixos users know, and maybe see if someone has ideas for better stopgap solutions than manually killing the session.
Btw, while I was looking into this issue, I also stumbled upon:
which suggests to stop the session with a separate target:
A special
sway-session-shutdown.targetcan be used to stop the
graphical-session.targetand thesway-session.targetwith all the contained
services.
systemctl start sway-session-shutdown.targetwill apply theConflicts=
statements in the unit file and ensure that everything is exited, something that
systemctl stop sway-session.targetis unable to guarantee
I wonder if it might make sense to adopt this (though it wouldn’t address this issue, since the swaymsg -t subscribe failure happens earlier). It seems that it’s already packaged in nixpkgs, though only for the assign-cgroups functionality.