Detect new available names in bus

Ralf Habacker ralf.habacker at freenet.de
Thu Feb 17 09:45:19 UTC 2022


Am 17.02.22 um 05:52 schrieb Lawrence D'Oliveiro:
> On Tue, 15 Feb 2022 14:13:32 +0100, Sergio Costas wrote:
> 
>> About NameOwnerChanged, it only notifies when a daemon actually
>> acquires a name, but that requires it to be launched. This means that
>> an activatable service won't emit that unless any of their methods is
>> called, thus loading the daemon. Again, that's not what I need. What
>> I need is to detect when the .service file is added or removed.
> 
> Is there any reason why bus peers need to be aware of the difference
> between an “activatable” service and one which is already running?
> 
> It seems to me a lot of this complexity would go away if the D-Bus
> daemon preregistered the names for such services on the bus.

You are referring to what is reproducible with the following commands ?

$ dbus-daemon 
--config-file=test/data/valid-config-files/tmp-session.conf --print-address
...
unix:abstract=/tmp/dbus-IopuBcjVhR,guid=c984f9f85ee8a453b4eba5c0620e14a
...

$ export 
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-IopuBcjVhR,guid=c984f9f85ee8a453b4eba5c0620e14a

services are present:

$ qdbus org.freedesktop.DBus  / org.freedesktop.DBus.ListActivatableNames

org.freedesktop.DBus
org.freedesktop.DBus.TestSuite.PrivServer
org.freedesktop.DBus.TestSuiteForkingEchoService
org.freedesktop.DBus.TestSuiteSegfaultService
org.freedesktop.DBus.TestSuiteEchoService
org.freedesktop.DBus.TestSuiteShellEchoServiceFail
org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess


but not visible on the bus:

$ qdbus
:1.1
org.freedesktop.DBus


after calling one:

$ qdbus org.freedesktop.DBus.TestSuiteEchoService
/
/org
/org/freedesktop
/org/freedesktop/TestSuite

it is visible on the bus:

$ qdbus
:1.3
  org.freedesktop.DBus.TestSuiteEchoService
:1.4
org.freedesktop.DBus

Ralf



More information about the dbus mailing list