GNOME Bugzilla – Bug 546863
Where does one need to start dbus now?
Last modified: 2008-09-19 12:03:01 UTC
In gnome-session 2.23.6, the dbus launching code was removed. Okay, I can understand this not being the place for it. However, I'm confused as to where dbus-daemon should be started. It seems to me that if I was going to start GNOME from ~/.xinitrc, I would add: dbus-launch --exit-with-session gnome-session However, what do I do if I want to start GNOME from GDM? Shouldn't the gnome.desktop which ships with gnome-session have the following: Exec=dbus-launch --exit-with-session gnome-session This is what I'm using in the FreeBSD now, and it works, but I'm wondering what is the right solution.
Hi, I would try to start dbus-daemon as soon as feasibly possible in your system. In Fedora, we start it with /etc/X11/xinitrc.d/00-start-message-bus.sh. This ensures that dbus is available even to things which aren't integrated with GNOME (yet) like ssh-agent. But it probably makes sense as a fallback for gnome-session to start dbus if it isn't already started.
The command on the Exec line is automatically run through the Xsession script Different distros ship different Xsession scripts, but most have something along the lines of for i in /etc/X11/xinit/xinitrc.d/*; do . $i done In fedora we ship a file 00-start-session-bus.sh that does if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then eval `dbus-launch --sh-syntax --exit-with-session` fi
Thanks for the feedback. But back to this being a bug. What can be done to make sure dbus-daemon is properly launched for a GNOME session out of the box? As it stands now, every OS would have to bundle their own non-default solution. This was working in 2.22. I think there should be a fallback in 2.24.
*** Bug 546393 has been marked as a duplicate of this bug. ***
I think the simplest change would be for gnome-session to look for the DBUS_SESSION_BUS_ADDRESS environment variable; if it's not set, re-exec by prepending the current argv: execvp("dbus-launch", "dbus-launch", "--session", argv) Also of course to prevent infinite recursion make sure argv[0] isn't dbus-launch. (it can't be one line since you need to generate a new array, but that's the idea...)
Created attachment 116364 [details] [review] re-exec using dbus-launch if there is no session bus Initial patch, lightly tested with: jhbuild run env -u DBUS_SESSION_BUS_ADDRESS strace gnome-session
Created attachment 117706 [details] [review] Updated patch FWIW, we use this patch in openSUSE (that's Colin's patch, which applies to the latest releases).
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
I am still seeing this problem on OpenSolaris if I remove the line eval `dbus-launch --sh-syntax --exit-with-session` from my Xsession start up script and aloow gnome-session to start up dbus itself. Vincent, did you check that openSUSE has not started session dbus else where? I am getting Could not connect to session bus: Failed to connect to socket /tmp/dbus-cthKTikaMY: No such file or directory. Trussing this show that the file was unlink by the dbus-launch itself. Am wonder if this a race condition.
(In reply to comment #9) > I am still seeing this problem on OpenSolaris if I remove the line > eval `dbus-launch --sh-syntax --exit-with-session` > from my Xsession start up script and aloow gnome-session to start up dbus > itself. > Vincent, did you check that openSUSE has not started session dbus else where? Well, I didn't have a session bus without the patch, so... :-) > I am getting Could not connect to session bus: Failed to connect to socket > /tmp/dbus-cthKTikaMY: No such file or directory. > > Trussing this show that the file was unlink by the dbus-launch itself. Am > wonder if this a race condition. Is dbus running? Can you check if you have DBUS-related environment variable set?