On Fri, 03 Jan 2020 at 19:52:33 -0500, The Wanderer wrote: > On 2020-01-03 at 19:33, Simon McVittie wrote: > > D-Bus activation is a D-Bus feature where instead of starting a > > D-Bus service (another sort of daemon) "eagerly" in case it might be > > needed, the dbus-daemon starts that D-Bus service "lazily" the first > > time some other program sends a message to it. > > This sounds like the feature I was thinking of. I think I understood > that the way this message got from the originating program to D-Bus (and > thence to the service, once running) was by way of a socket which would > / should be owned by that service, much as you describe for systemd's > socket-activation feature
No, part of the purpose of the "message bus" part of D-Bus is that it provides a hub-and-spoke topology so that connecting n clients and services together only requires O(n) connections, not O(n**2). Clients connect to a socket owned by the message bus service, and send messages through it. Some messages are processed by the message bus itself. The rest have a header that tells the message bus which service is the intended destination, and it either: delivers the message to the destination service immediately; activates (starts) the destination service (via either traditional or systemd activation), and then delivers the message when it appears; or replies with an error message that means "no, I can't do that" (for example if the requested service isn't installed). Other IPC systems that are the same shape as D-Bus would often refer to the message bus service as a broker - it's the same thing. The reference implementation of the message bus is dbus-daemon, from the dbus package. Alternatives like dbus-broker exist, but are not currently available in Debian. For the well-known system bus (dbus-daemon --system) the socket is /var/run/dbus/system_bus_socket, and you can see connections to it in the output of netstat, lsof or ss. It is conceptually owned by the message bus service, but if socket activation is in use then it's really created by systemd on behalf of the message bus service. smcv