unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22565: Cannot talk to upowerd over D-Bus
@ 2016-02-05 14:32 Ludovic Courtès
  2016-02-07 14:49 ` Ludovic Courtès
  2016-02-17 22:03 ` Ricardo Wurmus
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-02-05 14:32 UTC (permalink / raw)
  To: 22565; +Cc: swedebugia

On GuixSD as of v0.9.0-1430-g234ea8a, attempts to talk to upowerd over
D-Bus fail:

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

See
<https://lists.gnu.org/archive/html/guix-devel/2016-01/msg01004.html>.

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#22565: Cannot talk to upowerd over D-Bus
  2016-02-05 14:32 bug#22565: Cannot talk to upowerd over D-Bus Ludovic Courtès
@ 2016-02-07 14:49 ` Ludovic Courtès
  2016-02-17 22:03 ` Ricardo Wurmus
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-02-07 14:49 UTC (permalink / raw)
  To: 22565; +Cc: swedebugia, request

tags 22565 notabug
close 22565
thanks

ludo@gnu.org (Ludovic Courtès) skribis:

> 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
at <http://andrusiv.com/blog/2011/12/12/shutdown-dbus.html> is several
years old.)

If we invoke methods that do exist, everything is fine:

--8<---------------cut here---------------start------------->8---
$ 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"
   ]
--8<---------------cut here---------------end--------------->8---

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:

--8<---------------cut here---------------start------------->8---
$ loginctl suspend 
Failed to suspend: Interactive authentication required.
--8<---------------cut here---------------end--------------->8---

I suppose we need some polkit magic to allow unprivileged users to
invoke those actions, but that’s a different issue.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#22565: Cannot talk to upowerd over D-Bus
  2016-02-05 14:32 bug#22565: Cannot talk to upowerd over D-Bus Ludovic Courtès
  2016-02-07 14:49 ` Ludovic Courtès
@ 2016-02-17 22:03 ` Ricardo Wurmus
  2016-02-21 22:47   ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2016-02-17 22:03 UTC (permalink / raw)
  To: 22565

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#22565: Cannot talk to upowerd over D-Bus
  2016-02-17 22:03 ` Ricardo Wurmus
@ 2016-02-21 22:47   ` Ludovic Courtès
  2016-02-29  7:13     ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-02-21 22:47 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 22565

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.

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#22565: Cannot talk to upowerd over D-Bus
  2016-02-21 22:47   ` Ludovic Courtès
@ 2016-02-29  7:13     ` Ricardo Wurmus
  2016-02-29  9:29       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2016-02-29  7:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 22565


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.

xfce4-session sends “PowerOff” to “org.freedesktop.login1” via DBus and
gets “org.freedesktop.DBus.Error.InteractiveAuthorizationRequired” back,
which causes the whole thing to fail.  (I wonder why it doesn’t use the
fallback mechanism to shut down, but maybe that’s because it detected
systemd/logind and committed to shutting down via DBus.)

So maybe it’s not fine after all.

~~ Ricardo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#22565: Cannot talk to upowerd over D-Bus
  2016-02-29  7:13     ` Ricardo Wurmus
@ 2016-02-29  9:29       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-02-29  9:29 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, 22565

Ricardo Wurmus <rekado@elephly.net> skribis:

> 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 which
users 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’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-29  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-05 14:32 bug#22565: Cannot talk to upowerd over D-Bus Ludovic Courtès
2016-02-07 14:49 ` Ludovic Courtès
2016-02-17 22:03 ` Ricardo Wurmus
2016-02-21 22:47   ` Ludovic Courtès
2016-02-29  7:13     ` Ricardo Wurmus
2016-02-29  9:29       ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).