Standard setup for session bus?

Havoc Pennington hp at redhat.com
Wed Jun 23 10:09:42 PDT 2004


On Wed, 2004-06-23 at 00:42, Christian Hammond wrote:
> It seems to me that the best solution would be something ran out of
> login scripts that would cause dbus-launch to be run once, and only
> once, for the user. Console would be taken care of, and X would be
> taken care of. However, I would not be surprised if there's an issue
> there that I'm not thinking about.

That would be a user bus, not a session bus. ;-) (i.e. the session bus
is by definition per-session, i.e. per X login or virtual terminal
login)

For the desktop most things should be per-session so we decided that was
the right bus to have as the standard one.

> Is there a particular method that most people recommend?

I have not attempted to create a user.conf; the question you have to
answer is, "how do you locate the bus for a particular user?"

Our experience with gconfd and ORBit is: this is extremely difficult. 
It becomes a bit simpler if you say the bus is a user-machine bus. 
i.e. each system I log in to, I'll have a different bus.

If you are willing to require some systemwide setup, you could locate
the per-user bus address by having a service on the systemwide bus that
tracks the per-user buses. Or you could have a
/var/lib/user-message-bus-sockets/username1
/var/lib/user-message-bus-sockets/username2
etc.

If you aren't willing to require some systemwide setup you basically
have to put the socket in /tmp, which is a *nightmare* (see the code in
linc/ORBit that does this)

Keep in mind that a user-machine bus has limited utility, since users
can and do log in to multiple machines at the same time.

Anyhow, it is relatively trivial to have a user.conf that lets you
specialize dbus-daemon for a user bus; the hard part is defining how the
user bus works and what its semantics are, e.g. is it a user-machine bus
or a per-home-dir bus or what.

Havoc





More information about the dbus mailing list