[Patch] Auto-Close dbus-daemon when unused

Thiago Macieira thiago at kde.org
Fri Sep 25 09:34:13 PDT 2015


On Friday 25 September 2015 10:20:35 Leon Winter wrote:
> we can consider (a) fixed when having DBus tied to X11 by using
> "--exit-with-session" for such "user session = X11 session" scenarios.
> Luckily most dbus-dependent applications require X11 anyway so it not much
> of an ask for DBus to require X11 as well. However running non-X11
> DBus-dependent applications via SSH connections would then not be possible.
> I am currently not aware that we would have such non-X11 DBus-dependent
> applications running.
> 
> The issue (b) is partly addressed when using "autolaunching". Should no
> application require dbus, no dbus-daemon process is running. Yet when a
> single application autolaunch dbus it will stick around until the session
> ends despite nobody ever requires DBus any more (other then the application
> that spawned it in the first place). Sure, the dbus-daemon will be
> terminated once the user logs out, but *until* then it stays alive without
> purpose wasting resources. Following the terminology of "autolaunch", the
> feature I am proposing is "autoexit" very orthogonal in functionality but
> refering to the time span *after* dbus use instead of *before* dbus use.

Stop using autolaunch and start D-Bus at the beginning of your X11 session, 
like everyone else. It will exit when the X11 session exits.

autolaunch was created for running D-Bus applications in legacy environments 
that did not start X. We're in 2015, 10 years after D-Bus was created. Please 
don't give yourself the tag "legacy environment".

I don't want the autoexit feature for two reasons: first, there may be races 
associated with exiting the daemon, as you can't be sure that a process did 
not obtain the socket path before the X11 window was closed. And second, use 
of D-Bus is very common in modern Linux desktop applications, so it's not 
really wasting resources.

Finally, ssh and screen form separate sessions. Inheriting the environment 
variables in screen is wrong, but that's not our bug.
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the dbus mailing list