[systemd-devel] First steps with sd-bus

Iñigo Martínez inigomartinez at gmail.com
Mon Oct 5 03:59:43 PDT 2015


In a home made daemon, I needed to change some variables while
running, so I though about D-Bus as IPC and gived a chance to sd-bus.

Let's say that I'm trying it on a development system (currently a
debian jessie) without any users on it, just root, and some basic
libraries and configuration.

After reading Lennarts article[0] I tried to compile the bus-service.c
example. Here came the first problem:

   Failed to connect to system bus: No such file or directory

Obviously, as the system isn't executing a user bus, the service can't
find it, so I fixed it by changing:

  r = sd_bus_open_user(&bus);

to:

  r = sd_bus_open_system(&bus);

This way it uses a new connection to the system bus instead of the
nonexistent user bus, but it doesn't work either with a new problem
when requesting the name:

  Failed to acquire service name: Permission denied

I was supposed to have the rights to request the name as root (without
any security model like selinux), but I couldn't.

Any hint on what is going on around this problem ?

Thanks,

Best regards,

[0] http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html


More information about the systemd-devel mailing list