[systemd-devel] how to correctly specify dependency on dbus

prashantkumar dhotre prashantkumardhotre at gmail.com
Wed Apr 26 04:39:25 UTC 2017


Hi
For my service,  I have:

# cat my.service
[Unit]
Description=My Service
After=dbus.service
Requires=dbus.service
...
...

Some time i see that my service fails to get dbus connection
(dbus_bus_get_private() fails without any error msg).
one possibility i think is that dbus is not fully initialized.
>From above service file config, i understand when i start my service,
dbus service is started 1st and then my service.
but i am not sure if my service start step is delayed until dbus is
fully up , initialized and running and ready to accept conections.
is there a way to specify this in my service file.

For ex, for systemd-networkd,service, i see it specify  like :

# On kdbus systems we pull in the busname explicitly, because it
# carries policy that allows the daemon to acquire its name.
Wants=org.freedesktop.network1.busname
After=org.freedesktop.network1.busname


Can i use same (specifying After/Wants on a dbus name) ?
Appreciate your help on this.
Thanks


More information about the systemd-devel mailing list