scope autolaunch to client

Lennart Poettering mzqohf at 0pointer.de
Thu Dec 23 12:38:16 PST 2010


On Sun, 19.12.10 15:07, Colin Walters (walters at verbum.org) wrote:

> See:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=32509
> 
> Review appreciated; people are bugging me about this...
> 
> (Insert standard hatred of autolaunch and wish to cleanse with nuclear
> fire here)

Grr. I hate auto-termination even more than I dislike auto-spawning of
daemons from within process contexts.

The problem with auto-termination-on-idle is that it is really hard get
right in most cases, and for normal D-Bus services even vrtually
impossible, since there is no atomic way to do "i have no active
connection and nothing is queued for me, hence I terminate
now". i.e. between the time you decide you are idle and the time you
exit (or close your listening socket) another connection might have come
in.

In the SSH case I am more tempted to bind the lifetime of the bus to the
validity of the original stdin. i.e. keep an fd for the original fd
around in the bus process, and add it to the poll() with events=0, and
the momet it is closed from the other side a POLLHUP will be signalled
and we can shut down. This avoids the atomicity problem by simple not
caring whether dbus is idle or not, but by simply saying that when the
session ends it ends.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the dbus mailing list