tags 22565 notabug
close 22565
thanks
ludo@gnu.org (Ludovic Courtès) skribis:
Toggle quote (9 lines)
> On GuixSD as of v0.9.0-1430-g234ea8a, attempts to talk to upowerd over
> D-Bus fail:
>
> $ sudo dbus-send --print-reply --system --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
>
> See
> <https://lists.gnu.org/archive/html/guix-devel/2016-01/msg01004.html>.
Actually the above method simply does not exist (the blog post
years old.)
If we invoke methods that do exist, everything is fine:
Toggle snippet (14 lines)
$ dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.GetCriticalAction
method return time=1454855982.307374 sender=:1.1 -> destination=:1.51 serial=449 reply_serial=2
string "PowerOff"
$ dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.GetDisplayDevice
method return time=1454855987.010638 sender=:1.1 -> destination=:1.52 serial=450 reply_serial=2
object path "/org/freedesktop/UPower/devices/DisplayDevice"
$ dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.EnumerateDevices
method return time=1454856012.554536 sender=:1.1 -> destination=:1.53 serial=451 reply_serial=2
array [
object path "/org/freedesktop/UPower/devices/line_power_AC"
object path "/org/freedesktop/UPower/devices/battery_BAT0"
]
The thing is, poweroff/suspend/hibernate is now delegated to logind (see
src/linux/up-backend.c in UPower.)
Indeed, the ‘loginctl’ command (or, presumably, other elogind clients
such as GNOME or Xfce) can talk to elogind:
Toggle snippet (4 lines)
$ loginctl suspend
Failed to suspend: Interactive authentication required.
I suppose we need some polkit magic to allow unprivileged users to
invoke those actions, but that’s a different issue.
Thanks,
Ludo’.