Gnome-session inhibits suspend for no obvious reason
Fedora 31, gnome-session 3.34
First of all, most of the time suspending my laptop works absolutely fine. Either, via closing the lid, after the timeout set in /org/gnome/settings-daemon/plugins/power/sleep-inactive-battery-timeout
respectively /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-timeout
or running systemctl suspend
. But sometimes, that does not work for no obvious reason (no youtube video running etc.).
When having this problem, systemctl suspend
just returns
Operation inhibited by "bjoern" (PID 1669 "gnome-session-b", user bjoern), reason is "user session inhibited".
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl suspend -i'.
but unfortunately it does not show the exact process/program inhibiting it (or whether it is gnome-session
itself inhibiting the suspend).
systemd-inhibit --list
also does not give any more information and just returns
WHO UID USER PID COMM WHAT WHY MODE
ModemManager 0 root 900 ModemManager sleep ModemManager needs to reset devices delay
NetworkManager 0 root 1041 NetworkManager sleep NetworkManager needs to turn off networks delay
UPower 0 root 1235 upowerd sleep Pause device polling delay
GNOME Shell 1000 bjoern 1683 gnome-shell sleep GNOME needs to lock the screen delay
bjoern 1000 bjoern 1775 gsd-power handle-lid-switch External monitor attached or configuration changed recently block
bjoern 1000 bjoern 1774 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
bjoern 1000 bjoern 1669 gnome-session-b shutdown:sleep user session inhibited block
bjoern 1000 bjoern 1774 gsd-media-keys sleep GNOME handling keypresses delay
bjoern 1000 bjoern 1775 gsd-power sleep GNOME needs to lock the screen delay
9 inhibitors listed.
systemctl suspend -i
then obviously works. The automatic suspend only works again after killing and starting a new session.