Detect new available names in bus

Ralf Habacker ralf.habacker at freenet.de
Tue Feb 15 12:58:42 UTC 2022


Am 15.02.22 um 11:35 schrieb Sergio Costas:
> 
> El 15/2/22 a las 10:44, Ralf Habacker escribió:
>>
>> If dbus is build with inotify support on Linux, it will watch 
>> directories specified as service directory (see 
>> https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/bus/dir-watch-inotify.c). 
>>
>>
>> If files are changed, a SIGHUP signal is send to the dbus server 
>> process 
>> (https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/bus/dir-watch-inotify.c:74), 
>> which reloads configuration files (see 
>> https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/doc/dbus-daemon.1.xml.in#L73) 
>>
>>
> Which confirms that the dbus daemon is already monitoring those folders 
> (both with inotify for linux and kqueue for BSD), so adding that dbus 
> signal sould be quite straightforward...
> 
> So... How much complex is to submit a proposal for modifying the 
> specification...?
> 

Have you checked 
https://dbus.freedesktop.org/doc/dbus-specification.html to see if there 
is already a signal that meets your requirements?

A quick look shows me that these may be usable here:

org.freedesktop.DBus.NameOwnerChanged - This signal indicates that the 
owner of a name has changed. It's also the signal to use to detect the 
appearance of new names on the bus.


org.freedesktop.DBus.NameLost - This signal is sent to a specific 
application when it loses ownership of a name.

org.freedesktop.DBus.NameAcquired - This signal is sent to a specific 
application when it gains ownership of a name.

Ralf


More information about the dbus mailing list