Skip to main content
Topic: Broken suspend with `loginctl suspend` only when Sway is used. (Read 1150 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Broken suspend with `loginctl suspend` only when Sway is used.

Hello all,

It is my first time using Artix and I have a week old install set up with linux-zen, runit, elogind and Sway.

Here is a description of the issue I'm facing:

On a tty, before launching Sway, issuing `loginctl suspend` works as expected.

Sway is launched ( with `exec dbus-run-session sway`, if that matters... ) and I open a terminal.

Now, if I issue `loginctl suspend` it starts the suspension process. It disables the network, locks the screen (I have this set up on .config/sway/config), but the screen is not turned off and it seems the suspension process stops there.
In this state I can unlock the screen and use the terminal but `loginctl` commands doesn't work properly. I have to reboot the system to get it working correctly again (with `sudo reboot`, `loginctl reboot` doesn't work).

Now, if instead of using `loginctl`, I issue `cat mem >| /sys/power/state` from a terminal inside Sway, the system suspends successfully, but, of course, doesn't go through the `before-sleep` steps I have in .config/sway/config and leaves the session unlocked.

Does anyone faces the same issue as me?

On the same machine I have an Arch install with basically the same setup, but, of course, using systemd, and I don't have this issue there. Could this be a bug then on elogind or Sway's integration with it?

I'll boot up my Artix install again and I'll get the `/var/log/everything.log` to put here as a new comment below

Re: Broken suspend with `loginctl suspend` only when Sway is used.

Reply #1
Here is the everything.log after I issue `loginctl suspend`

Quote
Jan 28 09:43:51 artixXPS15 NetworkManager[1102]: <info>  [1643391831.9696] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Jan 28 09:43:51 artixXPS15 NetworkManager[1102]: <info>  [1643391831.9698] device (p2p-dev-wlan0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Jan 28 09:43:51 artixXPS15 NetworkManager[1102]: <info>  [1643391831.9705] manager: NetworkManager state is now ASLEEP
Jan 28 09:43:51 artixXPS15 NetworkManager[1102]: <info>  [1643391831.9708] device (wlan0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
Jan 28 09:43:51 artixXPS15 dbus-daemon[1101]: [system] Activating service name='org.freedesktop.nm_dispatcher' requested by ':1.0' (uid=0 pid=1102 comm="NetworkManager -n ") (using servicehelper)
Jan 28 09:43:51 artixXPS15 dbus-daemon[1101]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jan 28 09:43:51 artixXPS15 kernel: wlan0: deauthenticating from 18:7c:0b:13:fa:99 by local choice (Reason: 3=DEAUTH_LEAVING)
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: CTRL-EVENT-DISCONNECTED bssid=18:7c:0b:13:fa:99 reason=3 locally_generated=1
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0449] device (wlan0): supplicant interface state: completed -> disconnected
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0449] device (wlan0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0597] dhcp4 (wlan0): canceled DHCP transaction
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0598] dhcp4 (wlan0): state changed bound -> terminated
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: PMKSA-CACHE-REMOVED 18:7c:0b:13:fa:99 0
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: PMKSA-CACHE-REMOVED 18:7c:0b:10:10:59 0
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: PMKSA-CACHE-REMOVED 18:7c:0b:10:03:b9 0
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: PMKSA-CACHE-REMOVED 18:7c:0b:10:10:5d 0
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: PMKSA-CACHE-REMOVED 18:7c:0b:10:03:bd 0
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: PMKSA-CACHE-REMOVED 18:7c:0b:13:fa:9d 0
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0629] device (wlan0): set-hw-addr: set MAC address to 2A:07:1D:8F:41:51 (scanning)
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0690] device (wlan0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Jan 28 09:43:52 artixXPS15 NetworkManager[1102]: <info>  [1643391832.0711] device (wlan0): set-hw-addr: reset MAC address to 3C:9C:0F:09:5A:DD (unmanage)
Jan 28 09:43:52 artixXPS15 kernel: PM: suspend entry (deep)
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: p2p-dev-wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: p2p-dev-wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0
Jan 28 09:43:52 artixXPS15 kernel: Filesystems sync: 0.008 seconds
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 28 09:43:52 artixXPS15 wpa_supplicant[1132]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0

No other information is printed out...

Re: Broken suspend with `loginctl suspend` only when Sway is used.

Reply #2
I would think this is an upstream issue. Maybe something to do with libseat.

 

Re: Broken suspend with `loginctl suspend` only when Sway is used.

Reply #3
I ended up moving to seatd for seat management (in lieu of elogind) and now I can suspend with `loginctl suspend`.
Of course, there is no integration anymore between sway and loginctl and `swayidle before-sleep ...` stuff doesn't work.
I'm putting the `before-sleep` steps in a /lib/elogind/system-sleep/sway-before-sleep.sh script now.