D-Bus in jhbuild: Confusion and hacks

Jhbuild seems to have a general problem with D-Bus. This has become obvious now that GConf is using D-Bus instead of ORBit (see these gconf-list messages: 1, 2).

To make GConf work in jhbuild, you need to do this in each jhbuild shell:

dbus-launch --exit-with-session bash

Then there’s the problem of Avahi. To make Avahi work in jhbuild, you need to do this in each jhbuild shell:

export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket

I wish that jhbuild has some general solution for these issues by default because I suspect that these are just hacks.

However, I imagine that it’s a difficult problem. For instance, you probably don’t want to kill the main (non-jhbuild) D-Bus (and D-Bus services) because that would break your desktop. But you probably want a different D-Bus (and D-Bus services) for jhbuild. The two prefixes don’t seem to work well together in D-Bus at the moment.

5 thoughts on “D-Bus in jhbuild: Confusion and hacks

  1. You are right it is a difficult problem because some people use jhbuild just for one module (then using the existing buses is what you want), but others are using whole sessions (then jhbuild should start a session bus), and other just mix system and jhbuild modules.

    I am not using such a setup but it may help to add /jhbuild/root/share/dbus-1/services/ to dbus session.conf (that if you want the distribution installed d-bus to autostart services installed within jhbuild, I believe your gconf situation is that one).

  2. The jhbuild shell just needs to set DBUS_SYSTEM_BUS_ADDRESS, output a dbus session config file and use this line in the .desktop file:

    Exec=jhbuild run dbus-launch –config-file=jhbuild-dbus.conf gnome-session

    of course I think the modern gnome-session execs D-Bus as a plugin insead of D-Bus starting gnome-session so perhaps the jhbuild gnome-session plugin can take care of this though I admit I know little of how gnome-session works these days so I could be wrong.

  3. Hmm, why is JHBuild compiling D-Bus in the first place? If it is compiling D-Bus it could just set the –with-system-socket= flag for the system bus fix and make sure the session bus config file is pointing to the right data dir though doing a dbus-launch in run would always be a good idea so it works with single app instances.

  4. Thanks, John, but:

    > The jhbuild shell just needs to set DBUS_SYSTEM_BUS_ADDRESS, output a dbus session config file and use this line in the .desktop file:

    What .desktop file?

    > Actually looking at the code dbus-launch could be run in jhbuild’s run command so that it works for a complete session and single apps.

    But I’m asking about running “jhbuild shell”, not running an entire GNOME desktop.

    > Hmm, why is JHBuild compiling D-Bus in the first place?

    To get the latest API so it can build all the things above D-Bus, such as HAL, so it can get their latest API, so it can build stuff above them.

Leave a Reply

Your email address will not be published. Required fields are marked *