[Pkg-systemd-maintainers] Bug#717661: New suspend functionality causes double-suspend for environments not supporting the inhibit API
Michael Biebl
biebl at debian.org
Tue Jul 23 16:02:37 BST 2013
Am 23.07.2013 16:44, schrieb Michael Biebl:
> We could also ship an autostart file in systemd itself, which runs
> everywhere besides GNOME and KDE
I played a bit with this idea. The problem is, systemd-inhibit needs to
be tied to a running process, so I've tried this autostart file:
[Desktop Entry]
Name=systemd-inhibit
Comment=Inhibit systemd power events
Exec=systemd-inhibit
--what=handle-lid-switch:handle-power-key:handle-suspend-key:handle-hibernate-key
sleep 9999d
Terminal=false
Type=Application
NoDisplay=true
NotShowIn=KDE;
This has the unpleasant side-effect, that systemd-inhibit still keeps
running after the logout, since sleep is not killed during the logout.
An alternative idea was, to tie it to the dbus user session:
diff --git a/X11/Xsession.d/75dbus_dbus-launch
b/X11/Xsession.d/75dbus_dbus-launch
index af7ba49..afc19a9 100644
--- a/X11/Xsession.d/75dbus_dbus-launch
+++ b/X11/Xsession.d/75dbus_dbus-launch
@@ -5,6 +5,7 @@
STARTDBUS=
DBUSLAUNCH=/usr/bin/dbus-launch
+INHIBIT="systemd-inhibit
--what=handle-lid-switch:handle-power-key:handle-suspend-key:handle-hibernate-key"
if has_option use-session-dbus; then
if [ -x "$DBUSLAUNCH" ]; then
@@ -13,5 +14,5 @@ if has_option use-session-dbus; then
fi
if [ -n "$STARTDBUS" ]; then
- STARTUP="$DBUSLAUNCH --exit-with-session $STARTUP"
+ STARTUP="$INHIBIT $DBUSLAUNCH --exit-with-session $STARTUP"
fi
This way, systemd-inhibit is properly killed on logout. This does have
the downside of having to encode in a single file, in which desktop
environment it should be run or not.
Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20130723/93694d74/attachment-0002.sig>
More information about the Pkg-systemd-maintainers
mailing list