Launching D-Bus

John (J5) Palmieri johnp at
Wed Jan 16 15:13:17 PST 2008

On Wed, 2008-01-16 at 17:37 -0500, Shreevatsa R wrote:
> On Jan 16, 2008 5:08 PM, Colin Walters <walters at> wrote:
> > On Jan 16, 2008 5:01 PM, Shreevatsa R <shreevatsa.public at> wrote:
> > > Hi,
> > >
> > > My current understanding is this:
> > > When a D-Bus-using program is started,
> > >  (a) if DBUS_SESSION_BUS_ADDRESS is set, it uses that bus
> >
> > Applications can choose to connect to the session or system bus.
> Right, I should I have said "When a D-Bus-session-bus-using program is started".
> >
> > >  (b) else, it invokes dbus-launch --autolaunch. This will:
> >
> > libdbus certainly doesn't try to spawn a bus for you, because that
> > would generally be wrong.
> Are you sure?

It does autolaunch.

> > > Now, I am on OS X, and not running X11 [...]
> > > So my question is: How do I launch dbus and have the session bus
> > > address available to all programs that are launched later?
> >
> > The way it works on Unix/Linux/X11 is typically that it runs as part
> > of a "session startup" script.  I have no idea how this works on OS X,
> > but you should try to find out what the place is where any
> > subprocesses will inherit the environment variable.
> >
> > There is also the detail that babysitting using the X connection
> > doesn't really work if you're not running X...ideally the dbus-launch
> > script would have support for monitoring an OS X login session and
> > terminating when it closes.
> I haven't tried hard enough to find it, but ideally there would be a
> way for D-Bus to find its running bus without depending on things like
> X. I should be able to call dbus-launch, have the bus started, and
> available (and findable) to all programs while it's running. The "file
> in ~/.dbus/sesion-bus/" looks like it's a way to do this, really; can
> anyone tell me about it?

So on OS X I bet there is some last mile work that needs to be done to
make D-Bus work well.  Semantics are a bit different.  Autolaunch is a
bit of hack to make applications work over ssh or in the shell when they
requires D-Bus support.  The last time I looked at it we needed to find
a way to specify the bus address per session.  A file is suboptimal.
There should be a better way to set global session data and someone
would need to add a patch to support this.

John (J5) Palmieri <johnp at>

More information about the dbus mailing list