DBus on OS X: reintroducing "classical" X11 (auto-)start as a fall-back

René J.V. Bertin rjvbertin at gmail.com
Tue May 26 04:00:02 PDT 2015


On Tuesday May 26 2015 11:45:17 Simon McVittie wrote:

Hi,

Top-replying because I'm cc'ing a MacPorts ML with your reply.
Thanks for the feedback. I agree, but your suggestion also makes it an endeavour with so much more far-reaching implications (and opportunities to break everything) that I'm not sure to what extent I should be getting involved... The approach I planned initially only required understanding how the D-Bus daemon is launched, yours seems to require a rather intimate understanding of how it actually works, which I can't say I have.

I'll have a look though.

> On 21/05/15 09:53, René J.V. Bertin wrote:
> > The current DBus implementation for OS X only supports (auto) starting
> > through launchd, when the user is logged in a local, "Aqua" session.
> 
> D-Bus on OS X can at least theoretically support other transports and
> autolaunching mechanisms; my understanding is that the IPC offered by
> the Darwin kernel is broadly similar to FreeBSD, so everything that
> works on FreeBSD ought to work on Darwin.
> <https://bugs.freedesktop.org/show_bug.cgi?id=18013> also mentions X11
> autolaunching on OS X.
> 
> However, it is entirely possible that a dbus compiled with
> --enable-launchd does not gracefully fall back to other possibilities.

Currently it clearly doesn't; there is nothing that catches the error and attemps another launch method before returning the error to the user.

> The launchd support does not follow the same code paths as X11
> autolaunching, and I have never really understood why not. I would be
> happy to review tested patches to make them more similar.
> 
> X11 autolaunching is poorly understood and not amazingly reliable, so if
> it is possible to do so, I would encourage OS X users to arrange for a
> $XDG_RUNTIME_DIR as described in

This would be possible in distribution systems like MacPorts, Fink etc, but are that really the only sources through which people install D-Bus? Qt also provides D-Bus functionality and I'm not sure if that gets compiled in only when it's built locally and dbus libraries are found. And even if MacPorts, Fink etc. are the usual sources to install D-Bus from, there is the point that there is no such thing as XDG on OS X by default; would it be OK to use $TMPDIR (which is user-specific on all recent OS X versions I know of)?

> <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>
> to exist, then use $XDG_RUNTIME_DIR/bus as the D-Bus Unix socket, the
> same as is done on Linux systems with systemd if dbus >= 1.9.14 is
> compiled with --enable-user-bus. dbus >= 1.9.14 can be instructed to
> listen on "unix:runtime=yes" to achieve that.
> 
> I would also encourage you to write down the semantics that you think
> the session bus on OS X should have (preferably in a feature-request bug
> report on freedesktop.org Bugzilla) *before* trying to implement them.

Sounds like I'd be getting into a bootstrapping problem there :)


> One of the major historical problems with X11 autolaunching is that it
> addresses a large, vaguely-defined and sometimes conflicting set of
> requirements, such that we cannot be confident that any particular
> change is not a regression.
> 
> 

Regards,
René


More information about the dbus mailing list