[systemd-devel] how to call dbus ListUnits for user units?

Mantas Mikul─Śnas grawity at gmail.com
Tue May 26 12:22:34 PDT 2015


On Tue, May 26, 2015 at 9:33 PM, Chris Morgan <chmorgan at gmail.com> wrote:

> But I can't seem to figure out how to do the same for user units.
> There doesn't seem to be an org.freedesktop.systemd1 interface on my
> current user's session bus and I wasn't able to spot anything in the
> interfaces on the system bus that had a nested interface of
> org.freedesktop.system1.Manager...
>

The first "org.freedesktop.systemd1" here is a /service/ name; the usual
hierarchy is bus - service - object - interface - method, no such thing as
nested interfaces.

Anyway. The user processes are not allowed to own service names on the
system bus. And `systemd --user` is a per-user service, not a per-session
one, so it cannot be on the session bus for various reasons: it doesn't
know the bus address; it needs to outlive the session bus; the user might
sometimes have multiple sessions with their own 'session bus' instances.

So the idea is that `systemd --user` would be found on the /user/ bus,
which would someday replace the 'session' bus entirely.

But right now, the 'user' bus does not exist by default. To create it, you
need either
a) enable/install/boot with kdbus,
or b) obtain the "dbus.service" & "dbus.socket" user units. (They're in
dbus-git, or various other places like <
https://wiki.archlinux.org/index.php/Systemd/User#D-Bus>.)

Configured this way, the 'user' bus won't replace the session bus yet, but
you *will* be able to connect to it and reach systemd, at address
"kernel:path=/dev/kdbus/$UID-user/bus;unix:path=$XDG_RUNTIME_DIR/bus".

-- 
Mantas Mikul─Śnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150526/8d867589/attachment.html>


More information about the systemd-devel mailing list