9

The issue concerns the same thing which is described here and here, but I don't see a clear solution there. I mean I have the same error:

Failed to connect to socket /tmp/dbus-CwQMg2RxWx: Connection refused

and this is because I restarted my openbox session without restarting tmux . Gilles mentioned that I should:

start dbus-daemon explicitly early in your X session startup and give it a fixed address like unix:path=~/.dbus-$HOSTNAME-$DISPLAY.

but I don't really know where to put this address.

When I check dbus processes in my system, I get something like this:

$ ps -eo user,group,args | grep -i dbus
morfik   morfik   ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session
morfik   morfik   dbus-launch --sh-syntax --exit-with-session openbox-session
morfik   morfik   /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
message+ message+ /usr/bin/dbus-daemon --system
morfik   morfik   grep --color=auto -i dbus

Now I'm using just starx command to start X-server, I don't use lightdm anymore.

UPDATE#1

I finally managed to start dbus with a fixed address. The line should look like this:

unix:path=/home/morfik/.dbus/.dbus-morfikownia-0

I couldn't use : or ~ in the patch.

But there's a problem.

Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] sink.c: Default and alternate sample rates are the same.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] source.c: Default and alternate sample rates are the same.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] module-console-kit.c: Unable to contact D-Bus system bus: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] module.c: Failed to load module "module-console-kit" (argument: ""): initialization failed.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] main.c: Module load failed.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] main.c: Failed to initialize daemon.

Now, I have the following dbus processes:

morfik:~$ ps -eo user,group,args | grep -i dbus
message+ message+ /usr/bin/dbus-daemon --system --address=unix:path=/home/morfik/.dbus/.dbus-morfikownia-0
morfik   morfik   dbus-launch --sh-syntax --exit-with-session openbox-session
morfik   morfik   /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
morfik   morfik   grep --color=auto -i dbus

But the DBUS_SESSION_BUS_ADDRESS is still being set to a random value:

morfik:~$ env | grep -i dbus
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-W0pGpHoLOW,guid=20f83c74a8f5cef7e95ba8cb52fdb5cd

I changed it to

morfik:~$ export DBUS_SESSION_BUS_ADDRESS=unix:path=/home/morfik/.dbus/.dbus-morfikownia-0

to see what will happen, and for testing I used xfce4-notifyd-config and it still works. So, I checked another address:

morfik:~$ export DBUS_SESSION_BUS_ADDRESS=unix:path=/home/morfik/.dbus/.dbus-morfikownia-01

and it gave the error:

Failed to connect to socket /home/morfik/.dbus/.dbus-morfikownia-01: No such file or director

I placed the following line in /home/morfik/.config/openbox/environment :

export DBUS_SESSION_BUS_ADDRESS="unix:path=/home/morfik/.dbus/.dbus-morfikownia-0"

and I can start xfce4-notifyd-config in tmux without a problem now, but pulseaudio doesn't work. There's also some other issues. When I start firefox, I got the following error:

An error occurred while loading or saving configuration information for firefox. Some of your configuration settings may not work properly.

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

So, the solution with --address works partially, and I think it causes more harm than good. Maybe is there something else that has to be done?

1 Answers1

2
dbus-daemon --address="unix:path=~/.dbus-$HOSTNAME-$DISPLAY"

Put this in your ~/.xinitrc if you use startx, in ~/.xsession if you use a graphical X login manager with a custom session, or in whatever shell script your desktop environment runs when it starts. Note that if your system starts with a DBus daemon already, you may need to kill it first. This may affect some deskop environment's functionality.

With this setting, all DBus commands will concern the host where the process issuing the command is running, and not the remote GUI if you're logging in over SSH with X11 forwarding.

  • I'm unable to start X-server when I create one of the files and add the line to it. I also tried to start X-server using startx because I'm using lightdm, and I got this info: No configuration file specified. and xinit: connection to X server lost. When I remove the file, startx works. – Mikhail Morfikov Feb 13 '14 at 00:42
  • @MikhailMorfikov That's a different issue: finding what shell script runs when you log in in your configuration. It depends on your distribution (?), your login method (lightdm) and your desktop environment or session manager or window manager (Openbox). – Gilles 'SO- stop being evil' Feb 13 '14 at 03:54
  • I updated the question. Could you take a look? – Mikhail Morfikov Feb 14 '14 at 07:02