Question about file desriptors.

Thiago Macieira thiago at kde.org
Tue Sep 22 08:43:32 PDT 2009


Em Terça-feira 22 Setembro 2009, às 15:46:48, Stef Bon escreveu:
> > This is done completely independently of the system daemon.
> 
> Ok, two questions: what's a X11 atom?

You don't need to care about that, unless you want to read the dbus-launch-
x11.c source code. 

Suffice to say that dbus-launch stores the bus address and PID in the X11 
server, under a well-defined name that is also keyed to your machine and to 
your user name. That creates a perfect 1:1 tying of a session bus with the 
machine, username and X11 display.

> And what's so special about it that the dbus-launch program wants info
> from it?

That's where the bus address is saved in the X11 server.

I can explain the technical details, but I fear they would go completely over 
your head (if you're asking what an atom is, you probably have no experience 
with the X11 low-level library), and would also be completely irrelevant to 
the discussion.

> >> 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?

Yes. The bus daemon prints the information in separate file descriptors, so 
that the dbus-launch program can more easily read them.

> 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?

I don't know if it can create the files.

That's simply a communication mechanism between dbus-daemon and dbus-launch. 
You shouldn't need to care about them in your application. And you shouldn't 
be using them to launch D-Bus. You should be using dbus-launch.

> Ok, to be clear, I'm looking for other ways  to start the session dbus,
> like ConsoleKit and/or Upstart.

Why?

> 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?

No need for any change. The official way to start a session bus is via dbus-
launch. That should be enough.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  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
      http://qt.nokia.com/qtdevdays2009
-------------- 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 : http://lists.freedesktop.org/archives/dbus/attachments/20090922/9a15630d/attachment.pgp 


More information about the dbus mailing list