[systemd-devel] Multicast signaling with sd-bus questions

Lennart Poettering lennart at poettering.net
Tue Jan 12 12:49:00 PST 2016


On Tue, 12.01.16 20:25, Gorman, Brian (Vancouver) (bgorman at hp.com) wrote:

> Hi Lennart, Do you have any suggestions on where to look to see a
> good example of how to have a process emit a signal to a different
> DBus listening process using sd-bus? If matching against ":1.x" is
> not advised I am assuming I should request a name? My initial
> attempt is:

You can either emit directed or undirected signals (the latter is a
"broadcast"). If you want to send directed signals, then yes, it's
probably a good idea to make the target acquire a well-known name
first. But note that to acquire a well-known on the system bus name
you need the perms for it, and configure that via dbus XML
policy. (the user bus comes without restrictions, no need to
write any policy there). 

A simple way to issue signals is via sd_bus_emit_signal().

To acquire a name, use sd_bus_request_name().

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list