Question about file desriptors.

Stef Bon stef at bononline.nl
Tue Sep 22 06:46:48 PDT 2009


First thanks for your reply. You're making things much more clear to me.

>> If I've understood this dbus-launch program on his turn is started by
>> the system dbus-daemon,
>>     
>
> Wrong.
>
>   
>> 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.
>   
Ok, two questions: what's a X11 atom?
And what's so special about it that the dbus-launch program wants info 
from it?

>   
>> 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.
>   
OK, the question is not clear when I reread it. Is it a must to use 
filedescriptors?
As I understand, the files (to store pid and the address) are created 
and opened
by dbus-launch, and the dbus-daemon --session program writes to these 
files via
the filedescriptor. It's also possible to let the dbus-daemon session 
let create the files,
and the dbus-launch read it after it has started it?

Ok, to be clear, I'm looking for other ways  to start the session dbus, 
like ConsoleKit and/or Upstart.
ConsoleKit is the tool for sessionmanagment, and Upstart the tool to 
start programs/scripts
(in order acoording to dependency). I think that these should somehow 
integrate.

How do you look at this?

Stef
>   
>> 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.
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>   



More information about the dbus mailing list