#727605 Add support for systemd inhibit API

Package:
xfce4-power-manager
Source:
xfce4-power-manager
Description:
power manager for Xfce desktop
Submitter:
Michael Biebl
Date:
2014-06-19 17:21:05 UTC
Severity:
normal
#727605#5
Date:
2013-10-24 14:03:51 UTC
From:
To:
Package: xfce4-power-manager
Version: 1.2.0-2
Severity: normal
Tags: patch
User: pkg-systemd-maintainers@lists.alioth.debian.org
Usertags: systemd-logind


Hi,

when systemd-logind is active it will by default react to power events
and execute the actions configured in /etc/systemd/logind.conf.

A desktop environment usually wants to handle such events on their own.
E.g. they want to lock the screen on suspend or hibernate or show a
confirmation dialog before shutdown when the power button is pressed.

For that, the desktop environments are supposed to grab an inhibitor
lock [1] for the events it wants to handle.
There is a command line tool systemd-inhibit [2] which you can use to
inspect currently active locks and it can also be used to grab a lock.
As a desktop environment, you can either stick a call like
"systemd-inhibit --what=handle-lid-switch:handle-power-key:handle-suspend-key:handle-hibernate-key"
in your session start script or you let your desktop session component
responsible for power management grab that lock. This is e.g. how it's
done in GNOME, where gnome-settings-daemon is grabbing the lock and in
KDE, where PowerDevil, does the same.

There exist patches for xfce4-power-manager to use the logind inhibit
API and also use the suspend/shutdown/shutdown/reboot D-Bus API provided
by logind. Please not, that a working suspend/shutdown/shutdown/reboot
requires functionality from systemd, as logind will forward those
request to the running systemd process.
The patches are available at [3], specifically

a/ xfce4-power-manager-systemd-inhibit.patch
b/ xfce4-power-manager-systemd-shutdown-reboot-support.patch
c/ xfce4-power-manager-systemd-suspend-hibernate-suport.patch

You can choose to only apply a/ and continue to use upower, even when
systemd is active. But as you are already aware, the suspend/hibernate
functionality is going to be removed from upower 1.0, so it makes sense
to include b/ and c/ as well.

If you have further questions, please ask.


Michael



[1] http://www.freedesktop.org/wiki/Software/systemd/inhibit/
[2] http://www.freedesktop.org/software/systemd/man/systemd-inhibit.html
[2] https://build.opensuse.org/package/show/X11:xfce/xfce4-power-manager

#727605#10
Date:
2013-10-25 08:43:30 UTC
From:
To:
Actually, at this point, if we use c/ we lose upower suspend/hibernate
support completely (the check is done at built time), so I'm not really
sure I want to do that now.

Also, I don't think I got an answer from you about the upower issue.
Unless I'm mistaken, that means removing suspend/hibernate support from
*all* DEs unless init=/bin/systemd? Do we really want that in Debian?

Regards,

#727605#17
Date:
2014-06-19 17:17:26 UTC
From:
To:
xfce4-power-manager 1.2.0-4 now Recommends: systemd-shim | systemd-sysv,
and it arrived in testing a few days ago.

Unfortunately, this bug is unresolved -- systemd-shim's built-in power
management is not inhibited -- so I am seeing the "double-suspend"
behavior, described in #738294, when I close my laptop lid. Because of
the change in the dependencies, this now happens by default.

Should I file a separate bug for this issue?