D-Bus User Bus

Lennart Poettering mzqohf at 0pointer.de
Mon May 24 15:11:15 PDT 2010

On Thu, 20.05.10 10:00, Havoc Pennington (hp at pobox.com) wrote:

> Of course running a per-(user,machine) bus daemon is basically the
> same thing except you have to worry about when to start and stop it
> (and using the system bus to locate it is probably the easiest way to
> do that).

Again, I am not convinced that an IPC system should double as a process
manager. (I think that process management and babysitting is a job for
stuff like systemd.)

> Anyhow, having user-scoped services I don't think is bad (other than
> the extra complexity of having another bus, that's the only downside,
> maybe worth it). But removing the session-scoping or making
> user-machine-scoping the default, I do think would be a mess. And in
> the cron job case you still fundamentally have to deal with
> session-scoped stuff as long as you keep around any session-scoped
> stuff, or if you want your cron job to be in a DISPLAY session instead
> of being its own session.

Well, I see little need for the session bus:

* D-Bus is not really the best choice as a process manager. Since it is
  not privileged, it just doesn't work well as one.

* In a gdm world we only have 1 graphical session plus N
  ssh/console/cron/screen sessions at the same time for the same user,
  on a machine. For the GUI session it hence makes little sense if we
  have one bus per session or one per user. And for the
  ssh/console/cron/screen sessions there
  is little point in running their own dbus-daemon.

Putting that together it would be much nicer to allow
ssh/console/cron/screen sessions to simply join the graphical session
that is already set up.

I wonder if this something we should just leave to the distributions to
decide. i.e. We could say that from D-Bus upstream we leave it open
whether there is one "dbus-daemon --session" instance per user or one
per session. And the distros decide whether they go one way or the
other. Then, distros who continue to believe that multiple simulatenous
X11 logins by the same user make sense could go on configuring D-Bus
that way, and invest the resources to support setups like that. And
other distros, which use gdm anyway would just run one bus per user, and
hence make console/ssh/cron/screen session work much nicer.

Leaving this open would be nice for portability too, given that
launchd on MacOS is per-user and on Windows does not allow multiple
sessions by the same user anyway, afaik.


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the dbus mailing list