Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 876782 - upower-requested suspend actions seem to ignore systemd inhibitors
Summary: upower-requested suspend actions seem to ignore systemd inhibitors
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: upower
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 869998
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-15 00:01 UTC by William Brown
Modified: 2014-02-05 22:52 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-05 22:52:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description William Brown 2012-11-15 00:01:25 UTC
Description of problem:
Using the inhibit command line:

systemd-inhibit --what=handle-power-key:handle-suspend-key:handle-lid-switch /usr/bin/mate-power-manager

Checking the inhibitors list shows:

[william@franky 9:25]  /home/william> systemd-inhibit --list
WHAT                  WHO                  WHY                  MODE     UID    PID
handle-power-key:handle-suspend-key:handle-lid-switch /usr/bin/mate...bose Unknown reason       block   1000   6420

The laptop lid is closed, and suspend begins. Resuming the laptop, the laptop immediately sleeps again. This shows that both mate-power-manager, and systemd initiated a suspend action inspite of the presence of this inhibitor. Checking that this has not crashed on resume shows:

[william@franky 10:23]  /home/william> systemd-inhibit --list
WHAT                  WHO                  WHY                  MODE     UID    PID
handle-power-key:handle-suspend-key:handle-lid-switch /usr/bin/mate...bose Unknown reason       block   1000   6420

Note that the PID is the same - The mate-power-manager inhibitor was ignored, despite systemd being told to ignore lid-switch events.

How reproducible:
Always - I have just repeated this same test numerous times.

Resetting the inhibit script has no affect on the outcome.


Additional info:

There are no crashes reported by abrt. No errors in /var/log/messages. No denials in audit.log. No errors in journalctl.

Comment 1 William Brown 2012-11-26 23:55:37 UTC
This is still ongoing.

Comment 2 William Brown 2012-12-06 01:16:39 UTC
Still no communication about this, and the issue is still present.

Comment 3 Lennart Poettering 2013-01-07 13:53:38 UTC
If you open a terminal and run "systemd-inhibit --what=handle-power-key:handle-suspend-key:handle-lid-switch sleep 999999", and then open a second terminal and run "journalctl -u systemd-logind.service -f" and then suspend while that is running: what happens? still the double suspend? What do you see in the journalctl output? (please attach...)

Comment 4 Matthias Clasen 2013-01-07 14:29:20 UTC
You haven't mentioned which agent is doing the suspending here, and which mechanism it is using. Inhibiting systemd will only be effective if you are suspending via logind. If your desktop environment is e.g. calling out to pm-utils, it won't help.

Comment 5 William Brown 2013-01-07 23:58:32 UTC
I am using mate-power-manager, which in turn uses pm-utils. 

Jan 08 10:22:46 franky.firstyear.id.au systemd-logind[692]: Lid closed.
Jan 08 10:22:58 franky.firstyear.id.au systemd-logind[692]: Suspending...
Jan 08 10:22:58 franky.firstyear.id.au systemd-logind[692]: Lid opened.

WHAT                  WHO                  WHY                  MODE     UID    PID
handle-power-key:handle-suspend-key:handle-lid-switch william              Mate power ma...ents block   1000   2261

1 inhibitors listed.


If I run Lennart's command along side mate-power-manager, I get:

Jan 08 10:26:46 franky.firstyear.id.au systemd-logind[692]: Lid closed.
Jan 08 10:26:57 franky.firstyear.id.au systemd-logind[692]: Suspending...
Jan 08 10:26:57 franky.firstyear.id.au systemd-logind[692]: Lid opened.


WHAT                  WHO                  WHY                  MODE     UID    PID
handle-power-key:handle-suspend-key:handle-lid-switch william              Mate power ma...ents block   1000   2261
handle-power-key:handle-suspend-key:handle-lid-switch sleep 999999         Unknown reason       block   1000   2807

2 inhibitors listed.

And the same double sleep.

Of course, running with mate-power-manager disabled, and the systemd-inhibit command as provided, does not cause the laptop to sleep. 



I was under the impression that inhibiting systemd, was to prevent systemd from making power management decisions and delegating this to another system.

Comment 6 Lennart Poettering 2013-01-14 22:20:32 UTC
OK, i geuss mate should be updated then to use logind for suspending, the way upower/g-p-m already do.

Reassigning to mate.

Comment 7 Dan Mashal 2013-01-15 03:01:46 UTC
MPM already has a patch for this in Fedora. Unfortunately, it is still using a lot of the old 2.x code. Hopefully it will get fixed upstream soon.

Comment 8 Dan Mashal 2013-01-21 23:02:59 UTC
Reassigning to systemd.

Changing the following in /etc/systemd/logind.conf:
===
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
===

Seems to fix the problem for me. Seems more like  systemd/upower problem to me, Lennart.

Please correct me if I'm wrong and if I am wrong could you please fix this in systemd upstream or provide some type of patch for mate-power-manager?

"It works with Gnome 3" is not good enough. Other DE's are experiencing this issue as well.

Comment 9 Lennart Poettering 2013-01-25 01:00:28 UTC
Well, it's the mate maintainer's job to make sure their packages work fine with Fedora, not mine. They decided to fork GNOME, so the onus is on them to port the improvements over.

I don't run mate, I can't really debug this. 

Has anybody checked what code actually is responsible for the second suspend? Have you tried adding logging to the "pm-suspend" script? Maybe something still invokes that. Or consider adding an "exit 0" to it. If it doesn, then you just need to figure out which service invokes that.

Comment 10 Lennart Poettering 2013-03-07 16:28:42 UTC
I see nothing to fix in systemd here. Closing.

Feel free to reopen if there's actually a bug in systemd here.

Comment 11 Rex Dieter 2013-03-07 16:36:16 UTC
I'm guessing mate-power-manager is hitting the same thing we did in kde.  using suspend functionality via upower seems to be racy, and it all-too-often double-suspends.

Comment 12 Lennart Poettering 2013-03-08 03:24:12 UTC
If so consider opening a bug in upower!

Comment 13 Rex Dieter 2013-03-08 16:23:11 UTC
OK, reassigning, adjusting summary to:
upower-requested suspend actions seem to ignore systemd inhibitors

Comment 14 Dan Mashal 2013-04-21 17:00:58 UTC
https://github.com/mate-desktop/mate-power-manager/pull/55

"With upower 0.9.20, sleep and hybernate functions of upower
declared deprecated. All applications should use logind for
sleep/hybernate."

Comment 15 Rex Dieter 2013-04-21 17:38:45 UTC
Except f18 (currently) ships upower-0.9.19-1.fc18

Comment 16 Dan Mashal 2013-04-21 17:41:20 UTC
Regardless, it seems that this patch bypasses upower completely, and the problem is solved.

Comment 17 Rex Dieter 2013-04-21 20:07:10 UTC
I assume by "this patch" you mean the mate-power-manager patch?

Sure, problem is avoided for *you*, perhaps, but not other users of upower-for-suspend, like xfce.

Comment 18 Dan Mashal 2013-04-21 20:08:42 UTC
Yes. Maybe you could port to other power managers it since the upower maintainer seems to be unresponsive...

Comment 19 Rex Dieter 2013-04-21 20:11:14 UTC
I have.

In particular, xfce maintainers (so far) have been unwilling to include/port to anything < f19

Comment 20 Dan Mashal 2013-04-21 20:16:38 UTC
That is unfortunate.

Comment 22 Fedora End Of Life 2013-12-21 15:11:47 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 23 Fedora End Of Life 2014-02-05 22:52:56 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.