<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 26, 2015 at 10:32 PM, Chris Morgan <span dir="ltr"><<a href="mailto:chmorgan@gmail.com" target="_blank">chmorgan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Tue, May 26, 2015 at 3:22 PM, Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> wrote:<br>
> On Tue, May 26, 2015 at 9:33 PM, Chris Morgan <<a href="mailto:chmorgan@gmail.com">chmorgan@gmail.com</a>> wrote:<br>
>><br>
>> But I can't seem to figure out how to do the same for user units.<br>
>> There doesn't seem to be an org.freedesktop.systemd1 interface on my<br>
>> current user's session bus and I wasn't able to spot anything in the<br>
>> interfaces on the system bus that had a nested interface of<br>
>> org.freedesktop.system1.Manager...<br>
><br>
><br>
> The first "org.freedesktop.systemd1" here is a /service/ name; the usual<br>
> hierarchy is bus - service - object - interface - method, no such thing as<br>
> nested interfaces.<br>
><br>
> Anyway. The user processes are not allowed to own service names on the<br>
> system bus. And `systemd --user` is a per-user service, not a per-session<br>
> one, so it cannot be on the session bus for various reasons: it doesn't know<br>
> the bus address; it needs to outlive the session bus; the user might<br>
> sometimes have multiple sessions with their own 'session bus' instances.<br>
><br>
> So the idea is that `systemd --user` would be found on the /user/ bus, which<br>
> would someday replace the 'session' bus entirely.<br>
><br>
> But right now, the 'user' bus does not exist by default. To create it, you<br>
> need either<br>
> a) enable/install/boot with kdbus,<br>
> or b) obtain the "dbus.service" & "dbus.socket" user units. (They're in<br>
> dbus-git, or various other places like<br>
> <<a href="https://wiki.archlinux.org/index.php/Systemd/User#D-Bus" target="_blank">https://wiki.archlinux.org/index.php/Systemd/User#D-Bus</a>>.)<br>
><br>
> Configured this way, the 'user' bus won't replace the session bus yet, but<br>
> you *will* be able to connect to it and reach systemd, at address<br>
> "kernel:path=/dev/kdbus/$UID-user/bus;unix:path=$XDG_RUNTIME_DIR/bus".<br>
><br>
> --<br>
> Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>><br>
<br>
</div></div>Hmm. I guess user services aren't used as much as system ones are?<br>
<br>
Is there another way to interface with systemctl like functionality<br>
programmatically? I have a c application that today is shelling out to<br>
systemctl to start services (which is fine for me since I'm not that<br>
concerned if it fails but it would be nice to know right at that</blockquote><div><div><br></div><div>Note that systemctl *does* report failure as the process exit status + stderr output.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
time), but once everything is started I'd like to go through the<br>
services to make sure they all got started successfully. I didn't want<br>
to shell out to 'systemctl --user status xxx' and parse the output....<br></blockquote><div><br></div><div>Well, systemctl uses a private socket, at $XDG_RUNTIME_DIR/systemd/private. It speaks the same DBus protocol, but using a direct peer-to-peer connection (it's not a bus address).</div><div><br></div><div>Remember that it's named "private" for a reason -- it's not part of the supported API and can go away at any time (e.g. it won't exist anymore with kdbus), so use it at your own risk.</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>