Question about isatty/read usage in dbus-launch

Ray Strode halfline at
Fri Dec 1 19:45:39 PST 2006


> Then we'll have a sort of "dbus-launch roadmap" in the form of the use
> cases plus man page changes. It'd also be nice to figure out the bug Ray
> posted,
So in comment 22 of that bug, I mentioned that I had spent a little
time trying to strip out the read() call and instead rely on SIGHUP.
For those interested, the patch I was playing with at the time (that
didn't work out) is attached.

I think the problem may have something to do with the way dbus-launch
branches when it forks. At the time I was looking at this, I made a
little graph in my notes of the way it seemed to work:

    +---fork()----- sitter intermediate parent
    |                     |
waitpid                   +---fork()--- exec dbus-daemon
    |                     |
    |                  babysit
exec prog                 |
                          +---fork()--- kill_bus_when_session_ends

Which seems a bit odd to me.  The program passed to dbus-launch ends
up taking over the original PID of dbus-launch, and the first forked
child is what handles spawning the dbus-daemon, and creating a helper
process for watching the session.

I think doing it this way instead of running the passed program in a
subprocess might be contributing to the problem, although I don't have
a clear idea why in my head, and I haven't tried changing things

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 3491 bytes
Desc: not available
Url :

More information about the dbus mailing list