Tutorials
goetia
Software
0x53.net

Minimizing dbus

Usually, many desktop programs that are started after the display server, are started automatically by means of "dbus activation". That is, a program A asks the session bus for another program B, the session bus starts program B and then mediates communication.

This has advantages and disadvantages: As for the advantages: Services are only started once needed, if a service crashes it is restarted again only once and if it is needed again. As for the disadvantages: Services are not properly logged, since they are randomly started by dbus without a cconnected s6-log process. The entire concept leads to an unknown state, since one never knows whether a service is up and running or not. Additionally, this may result in conflicts with the user supervision tree

To circumvent this problem, there are two options:

  1. Disable the automatic activation. This is unfortunately not possible to do globally. Instead, one has to hand edit all files in all subdirectories at /usr/share/dbus-1/* (Linux) or /usr/local/share/dbus-1/* (BSD). changing Exec=whatEverDaemon to Exec=/usr/bin/true.
  2. Write a proper dbus-daemon-launch-helper that can talk to goetia.

Option one is currently the only one available. Disable all dbus services and use a nested user supervision tree to start the desired services after the compositor has been started.

An interesting, more detailed article about this problem is Avoid Desktop Bus (D-Bus) bus activation from Jonathan de Boyne Pollard.