6

The error I get is this:

GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. 
See http://projects.gnome.org/gconf/ for information. 
(Details -  1: Failed to get connection to session: Error connecting: Connection refused)
Failed to open bus: Failed to connect to socket /tmp/dbus-BYC0LHrEHk: Connection refused

Any suggestions?

4 Answers 4

5

Instead of letting Gnome run dbus-launch to create a random D-Bus address, start dbus-daemon explicitly early in your X session startup and give it a fixed address like unix:path=~/.dbus-$HOSTNAME-$DISPLAY.

Given the information in the bug report, you may even be able to get away with unset DBUS_SESSION_BUS_ADDRESS and let applications find out the bus address from the root window properties.

As of 15.10, the per-session dbus instance is created via an Upstart session job. The job file in question is /usr/share/upstart/sessions/dbus.conf. You can replace the default random address by overriding the pre-start script stanza which specifies the address to use. Create ~/.config/upstart/dbus.override with the following:

pre-start script
    DBUS_SESSION_BUS_ADDRESS=unix:path=$HOME/.dbus-$(hostname)-$(echo $DISPLAY | sed -e s/:/%3A/)
    initctl set-env DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS
end script

The fixed address will be used after you next log in.

3
  • What about on 16.04? The Upstart file is still present, so would it still work?
    – Oxwivi
    Sep 21, 2016 at 11:04
  • @Oxwivi This doesn't seem to have changed on 16.04, but I haven't tested. Sep 21, 2016 at 12:15
  • Just to let you know, it does work.
    – Oxwivi
    Sep 30, 2016 at 11:20
3

This is apparently a bug in gconf that already has a fix (if I understood correctly from this bug report). In the meantime, the following should work around the problem:

export DBUS_SESSION_BUS_ADDRESS=$(tr '\0' '\n' < /proc/$(pgrep -U $(whoami) gnome-session)/environ|grep ^DBUS_SESSION_BUS_ADDRESS=|cut -d= -f2-)
3

Or if as me you don't use gnome:

unset DBUS_SESSION_BUS_ADDRESS

1
  • Works for me, and I do use gnome!
    – mgalgs
    May 7, 2013 at 21:07
2

tmux can be told to always reset certain env vars:

update-environment variables

Set a space-separated string containing a list of environment variables to
be copied into the session environment when a new session is created or an
existing session is attached. Any variables that do not exist in the source
environment are set to be removed from the session environment (as if -r was
given to the set-environment command). The default is "DISPLAY SSH_ASKPASS
SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY".

Based on that it might be appropriate to add DBUS_SESSION_BUS_ADDRES to this option in ~/tmux.conf:

set-option -g update-environment "DBUS_SESSION_BUS_ADDRESS DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"

This worked for me.

3
  • Didn't work for me (Ubuntu 10.04)...
    – mgalgs
    May 7, 2013 at 21:07
  • Didn't work for me on Mint 15 :( ...what distro are you running?
    – hamstar
    Sep 16, 2013 at 3:11
  • I'm running Debian unstable, tmux version 1.8-4.
    – arand
    Sep 17, 2013 at 10:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .