You are not logged in.

#1 2021-10-16 02:36:02

makeworld
Member
Registered: 2019-10-24
Posts: 8

UPower sometimes keeps my laptop from suspending when I close the lid

I've noticed that sometimes when I close my laptop lid, it doesn't actually suspend, it just locks but stays running. When I open the laptop again, I'm greeted by this window:

Up03O1k.png

I did some research and ended up on the

systemd-inhibit --list

command, which gives this output:

WHO                 UID  USER      PID   COMM            WHAT                                                                       WHY                                       MODE 
NetworkManager      0    root      632   NetworkManager  sleep                                                                      NetworkManager needs to turn off networks delay
UPower              0    root      34617 upowerd         sleep                                                                      Execute critical action                   block
xfce4-power-manager 1000 makeworld 1106  xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events  block
xfce4-screensaver   1000 makeworld 862   xfce4-screensav sleep                                                                      Locking screen before sleep               delay

4 inhibitors listed.

UPower is the only unexpected item, and nothing else blocks except XFCE stuff which I expect, since I run XFCE. When I stop the UPower daemon with

sudo systemctl stop upower

, it immediately starts running again. I believe I read somewhere that it is started whenever a process requests it, maybe over DBus. It makes sense that it's starting all the time, since XFCE uses it to display battery info in the status bar. Anyway, once I restart or stop it with systemctl, the problem goes away, and it doesn't show up in

systemd-inhibit --list

anymore. But eventually it comes back, and so my system will fail to suspend again.

How can I fix this permanently? Is anyone else having this issue?

Last edited by makeworld (2021-10-16 15:09:43)

Offline

#2 2021-11-08 23:20:08

xerus
Member
Registered: 2021-05-11
Posts: 34

Re: UPower sometimes keeps my laptop from suspending when I close the lid

Today I was confused why my laptop wasn't going to sleep after connecting power after the battery had run almost empty, and found the exact same issue as you did.

Offline

#3 2021-11-09 01:45:47

makeworld
Member
Registered: 2019-10-24
Posts: 8

Re: UPower sometimes keeps my laptop from suspending when I close the lid

Glad it's not just me, I was feeling like I was going crazy. Crazier still, the issue seems to have gone away on my computer, I haven't experienced it for the past week or two. Not sure why it would go away, or if it will come back in the future.

Offline

#4 2021-12-17 03:16:15

sheu
Member
Registered: 2021-12-17
Posts: 3

Re: UPower sometimes keeps my laptop from suspending when I close the lid

I've filed an issue with upower and attached a merge request for a fix: https://gitlab.freedesktop.org/upower/u … issues/160

Doing my One Good Deed on the Intarwebs today, c.f.: https://xkcd.com/979/

Offline

#5 2021-12-17 03:34:17

makeworld
Member
Registered: 2019-10-24
Posts: 8

Re: UPower sometimes keeps my laptop from suspending when I close the lid

That's great, thank you. Still not experiencing this issue anymore like I mentioned before, but good to know it can be gone permanently.

Offline

#6 2021-12-17 03:46:07

sheu
Member
Registered: 2021-12-17
Posts: 3

Re: UPower sometimes keeps my laptop from suspending when I close the lid

You have to run into the case where the "critical battery action" gets cancelled, because that's where the leak occurs.  While I haven't reproed this myself, I think you could repro it by almost running out of battery (and getting whatever desktop notification), then cancelling the notification not by user interaction but by plugging into AC power.

Offline

#7 2021-12-17 03:56:58

makeworld
Member
Registered: 2019-10-24
Posts: 8

Re: UPower sometimes keeps my laptop from suspending when I close the lid

Ah, that makes more sense, it must just be that I haven't triggered it again. I was having battery issues that later resolved themselves, which would have stopped me from "almost running out of battery" as you describe. Thanks for explaining.

Offline

#8 2022-01-24 18:10:19

sheu
Member
Registered: 2021-12-17
Posts: 3

Re: UPower sometimes keeps my laptop from suspending when I close the lid

Fixed merged upstream as of a few hours ago, it'll show in your distro... whenever it shows up :-)

Have a nice day!

Last edited by sheu (2022-01-24 18:10:29)

Offline

Board footer

Powered by FluxBB