Question

I am new to dbus and I am trying to understand how to use it but I cannot seem to find the answers I seek.

Am I correct that I can invent my own service names as long as they are unique and do not conflict with any other service names?

When I call dbus_bus_request_name() requesting my own service name, I get an error that says I am not allowed to own that service due to security policies in the configuration file. In looking at the /etc/dbus-1 configuration directory, it appears that there is one system config file (/etc/dbus-1/system.conf) and then a sub directory of other config files for various services (/etc/dbus-1/system.d subdirectory).

I added a config file for my service name using the other .conf files as examples. But I do not see that the system.conf file reads any of the individual .conf files. Am I correct to assume that the individual config files will get read in somehow? So how do I get the system bus to re-read the system.conf file after editing one of the individual .conf files in the system.d directory, or after added a new service config file like I did?

Is this the proper way to configure the system bus so I can have 2 process pass messages? My application is a closed application consisting of several processes, so the only communication I intend to do thru the system dbus will only be between my own processes not any other public or other well known services.

Thanks,

-Andres

Was it helpful?

Solution

Am I correct that I can invent my own service names as long as they are unique and do not conflict with any other service names?

Yes

When I call dbus_bus_request_name() requesting my own service name, I get an error that says I am not allowed to own that service due to security policies in the configuration file.

I guess you're using the SYSTEM bus. Unless there's a reason to use the SYSTEM bus, it's easier to use the SESSION bus, especially for testing. There are other security things that the SYSTEM bus uses to ensure security of the system, take a look at some of the configuration files for the services, they show how to allow certain services to own specific names on the bus.

Am I correct to assume that the individual config files will get read in somehow?

Yes, if you look at the system.conf you can see the <includedir> tag, which will include everything in that directory.

So how do I get the system bus to re-read the system.conf file after editing one of the individual .conf files in the system.d directory, or after added a new service config file like I did?

Send a SIGHUP to the dbus-daemon.

Is this the proper way to configure the system bus so I can have 2 process pass messages?

That should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top