all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: 22565@debbugs.gnu.org
Cc: swedebugia@riseup.net, request@debbugs.gnu.org
Subject: bug#22565: Cannot talk to upowerd over D-Bus
Date: Sun, 07 Feb 2016 15:49:56 +0100	[thread overview]
Message-ID: <871t8oy3qj.fsf@gnu.org> (raw)
In-Reply-To: <87powbgrdi.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 05 Feb 2016 15:32:09 +0100")

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

  reply	other threads:[~2016-02-07 14:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871t8oy3qj.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=22565@debbugs.gnu.org \
    --cc=request@debbugs.gnu.org \
    --cc=swedebugia@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.