Question about file desriptors.

Thiago Macieira thiago at
Mon Sep 21 08:51:33 PDT 2009

Em Segunda-feira 21 Setembro 2009, às 15:13:14, você escreveu:
> Hello,
> when I look at the processlist with ps on my machine, I see something like:
> dbus-daemon --fork --print-pid 6 --print-address 8 --session
> It's launched by the dbus-launch program, right?


> If I've understood this dbus-launch program on his turn is started by
> the system dbus-daemon,


> when it recieves an call from an user without dbus-daemon running for
> his session.

That's not what happens. When a user tries to connect to the session daemon 
and $DBUS_BUS_SESSION_ADDRESS isn't set, the library runs dbus-launch asking 
it to figure out what the address is. It's called "autostart" mode.

Right now, it will connect to the X11 server and check if it's already 
registered there. If it is, it fetches the info from an X11 atom and returns 
to the library. If it isn't, it'll launch the server and save the info in X11.

This is done completely independently of the system daemon.

> Is it really neccesary that the dbus-daemon for a session is started by
> dbus-launch? 

No, you could run it manually, then set the environment variables on your own.

> I've read that
> the filedescriptors  are used by programs that launch the message bus.
> Is this mandatory??

Sorry, I did not understand the question.

> Some time ago I've used a construction to start the dbus-daemon for a
> session just by a script,
> writing the output to a file (which then contains the address and the
> pid) which is sourced by the bash
> shell when it starts. Is there something against this construction?

No. But that's exactly what dbus-launch is there for: to get that information 
from dbus-daemon, then produce a bash-sourceable script with the variables.

Thiago Macieira - thiago (AT) - thiago (AT)
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : 

More information about the dbus mailing list