Cannot talk to upowerd over D-Bus

DoneSubmitted by Ludovic Courtès.
Details
2 participants
  • Ludovic Courtès
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
L
L
Ludovic Courtès wrote on 5 Feb 2016 15:32
(address . bug-guix@gnu.org)(address . swedebugia@riseup.net)
87powbgrdi.fsf@gnu.org
On GuixSD as of v0.9.0-1430-g234ea8a, attempts to talk to upowerd overD-Bus fail:
Toggle snippet (4 lines)$ sudo dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.SuspendError org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
L
L
Ludovic Courtès wrote on 7 Feb 2016 15:49
(address . 22565@debbugs.gnu.org)
871t8oy3qj.fsf@gnu.org
tags 22565 notabugclose 22565thanks
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 postat http://andrusiv.com/blog/2011/12/12/shutdown-dbus.html is severalyears 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.GetCriticalActionmethod 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.GetDisplayDevicemethod 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.EnumerateDevicesmethod 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 (seesrc/linux/up-backend.c in UPower.)
Indeed, the ‘loginctl’ command (or, presumably, other elogind clientssuch 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 toinvoke those actions, but that’s a different issue.
Thanks,Ludo’.
R
R
Ricardo Wurmus wrote on 17 Feb 2016 23:03
bug#22565: Cannot talk to upowerd over D-Bus
(address . 22565@debbugs.gnu.org)
8737sr570u.fsf@elephly.net
I’m trying to figure out why we cannot use the Xfce menu to shut down orreboot, and while doing that I found that
loginctl poweroff
(as root on the TTY) does have the intended effect. When run as a userI see a similar error as mentioned above:
Failed to power off: Interactive authentication required.
I think this is just fine.
L
L
Ludovic Courtès wrote on 21 Feb 2016 23:47
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 22565@debbugs.gnu.org)
87lh6dr89f.fsf@gnu.org
Ricardo Wurmus <rekado@elephly.net> skribis:
Toggle quote (12 lines)> I’m trying to figure out why we cannot use the Xfce menu to shut down or> reboot, and while doing that I found that>> loginctl poweroff>> (as root on the TTY) does have the intended effect. When run as a user> I see a similar error as mentioned above:>> Failed to power off: Interactive authentication required.>> I think this is just fine.
I don’t know if it’s fine. :-) I would expect that on GNOME/Xfce apassword window would pop up when that RPC is invoked, but I’m not surehow it’s supposed to happen, or under what conditions.
Ludo’.
R
R
Ricardo Wurmus wrote on 29 Feb 2016 08:13
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 22565@debbugs.gnu.org)
87si0cat0v.fsf@elephly.net
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (18 lines)> Ricardo Wurmus <rekado@elephly.net> skribis:>>> I’m trying to figure out why we cannot use the Xfce menu to shut down or>> reboot, and while doing that I found that>>>> loginctl poweroff>>>> (as root on the TTY) does have the intended effect. When run as a user>> I see a similar error as mentioned above:>>>> Failed to power off: Interactive authentication required.>>>> I think this is just fine.>> I don’t know if it’s fine. :-) I would expect that on GNOME/Xfce a> password window would pop up when that RPC is invoked, but I’m not sure> how it’s supposed to happen, or under what conditions.
After strace’ing “xfce4-session” when clicking on the shutdown button inthe Xfce menu I see the same error returned over DBus.
xfce4-session sends “PowerOff” to “org.freedesktop.login1” via DBus andgets “org.freedesktop.DBus.Error.InteractiveAuthorizationRequired” back,which causes the whole thing to fail. (I wonder why it doesn’t use thefallback mechanism to shut down, but maybe that’s because it detectedsystemd/logind and committed to shutting down via DBus.)
So maybe it’s not fine after all.
~~ Ricardo
L
L
Ludovic Courtès wrote on 29 Feb 2016 10:29
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87lh63kgps.fsf@gnu.org
Ricardo Wurmus <rekado@elephly.net> skribis:
Toggle quote (23 lines)> Ludovic Courtès <ludo@gnu.org> writes:>>> Ricardo Wurmus <rekado@elephly.net> skribis:>>>>> I’m trying to figure out why we cannot use the Xfce menu to shut down or>>> reboot, and while doing that I found that>>>>>> loginctl poweroff>>>>>> (as root on the TTY) does have the intended effect. When run as a user>>> I see a similar error as mentioned above:>>>>>> Failed to power off: Interactive authentication required.>>>>>> I think this is just fine.>>>> I don’t know if it’s fine. :-) I would expect that on GNOME/Xfce a>> password window would pop up when that RPC is invoked, but I’m not sure>> how it’s supposed to happen, or under what conditions.>> After strace’ing “xfce4-session” when clicking on the shutdown button in> the Xfce menu I see the same error returned over DBus.
Presumably the underlying problem is the polkit issue (determining whichusers are “active” and thus allowed to execute privileged operation)that Andy has been working on and discussed on IRC and at:
https://lists.gnu.org/archive/html/guix-devel/2016-02/msg01139.html https://lists.gnu.org/archive/html/guix-devel/2016-02/msg01000.html https://gnunet.org/bot/log/guix/2016-02-28#T936426
Ludo’.
?
Your comment

This issue is archived.

To comment on this conversation send email to 22565@debbugs.gnu.org