[systemd-devel] dbus user services using the session bus

Will Stephenson wstephenson at kde.org
Wed Apr 3 06:22:08 PDT 2013


I'm joining the flock of desktop people investigating using systemd to 
start a desktop session.  So far I've checked out user-session-units and 
have created some more granular unit files that will do a native systemd 
start rather than u-s-u's wrapper around the upstream start script.

I'm stuck now, because I want to start a service with Type=dbus that 
puts a service on the session bus, however, I can't see a way to specify 
the bus in the unit file.

I don't want to use dbus activation here to start the service as that 
invokes the chicken-egg problem that the service in question (kdeinit) 
job is to start all the processes that will be calling it via dbus 
later. Long term I would like to do away with this and perform this task 
via systemd too, but Type=dbus on the session bus seems like a valid use 
case that should work.

I see there's a way to get the dbus session bus address into systemd 
because of the patch to fix this in user-session-units; would the right 
approach be to add a BusInstance= field to service and use the provided 
session bus address when watching for Type=dbus services that depend on 
user/dbus.service?

Any info greatly appreciated

Will


More information about the systemd-devel mailing list