dbus fork problem

David Zeuthen david at fubar.dk
Fri Apr 6 20:01:00 PDT 2007


On Thu, 2007-04-05 at 09:36 -0400, Havoc Pennington wrote:
> Hi,
> 
> Even in theory I'm not sure how a connection kept across fork() would 
> work... the behavior would be tough to define.
> 
> If you can spec out what you need then we can discuss the API.

No, this would break tons of stuff; for example the method
GetConnectionUnixProcessID() on the bus would start lying... while this
may be fixable (but I don't think it is unless you break ABI), it's just
not desirable - applications (like HAL) really wants to cache the PID
per unique name to avoid round trips to the bus every time the same
unique name calls into HAL.

Also, just for the record, applications that fork with a D-Bus
connection, will not work with recent HAL (e.g. with ConsoleKit enabled)
- we used the PID to figure out what desktop session (if any) the caller
originates from and this could fail if the parent exits. We do this to
deny service to inactive sessions for fast user switching. At least
gnome-power-manager got fixed to retrieve the connection before
daemonizing.

     David




More information about the dbus mailing list