Major desktop environments such as Xfce or KDE have a built-in computer suspend feature, but when you use a lighter alternative, things are a bit more complicated, because basically: only root can suspend the computer. There used to be a standard solution to that, using a D-Bus call to a running daemon upowerd. With recent updates, that solution first stopped working for obscure reasons, but it could still be configured back to be usable. With newer updates, it stopped working again, but this time it seems it is gone for good:
$ dbus-send --system --print-reply \ --dest='org.freedesktop.UPower' \ /org/freedesktop/UPower org.freedesktop.UPower.Suspend Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
The reason seems to be that upowerd is not running, because it no longer provides an init script, only a systemd service. So, if you do not use systemd, you are left with one simple and stable solution: defining a sudo rule to start the suspend or hibernation process as root. In /etc/sudoers.d/power:
%powerdev ALL=NOPASSWD: /usr/sbin/pm-suspend, \ /usr/sbin/pm-suspend-hybrid, \ /usr/sbin/pm-hibernate
That allows members of the powderdev group to
run sudo pm-suspend
, sudo pm-suspend-hybrid
and sudo pm-hibernate
, which can be used with a key
binding manager such as your window manager's or xbindkeys. Simple, efficient, and
contrary to all that ever-changing GizmoKit and whatsitd stuff, it has
worked and will keep working for years.
17 comments
wednesday 23 july 2014 à 16:21 michael said : #1
wednesday 23 july 2014 à 16:30 Tanguy said : #2
wednesday 23 july 2014 à 17:31 michael said : #3
wednesday 23 july 2014 à 17:48 Tanguy said : #4
wednesday 23 july 2014 à 17:56 Andrew Shadura said : #5
wednesday 23 july 2014 à 18:59 Philipp Kern said : #6
wednesday 23 july 2014 à 19:15 Tanguy said : #7
wednesday 23 july 2014 à 20:47 Steven C. said : #8
wednesday 23 july 2014 à 23:26 Philipp Kern said : #9
wednesday 23 july 2014 à 23:55 Tanguy said : #10
saturday 26 july 2014 à 03:26 Dave said : #11
thursday 31 july 2014 à 02:13 Clueless said : #12
thursday 31 july 2014 à 09:36 Tanguy said : #13
monday 12 january 2015 à 03:33 TestDummy said : #14
monday 12 january 2015 à 03:42 Chris said : #15
monday 12 january 2015 à 03:43 Christ said : #16
friday 16 october 2015 à 12:59 Toni said : #17