Bug 116702 - dbus-launch is executed twice on login
Summary: dbus-launch is executed twice on login
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: GNOME (show other bugs)
Version: RC 1
Hardware: Other All
: P1 - Urgent : Normal
Target Milestone: ---
Assignee: Rodrigo Moya
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-13 08:15 UTC by Timo Hoenig
Modified: 2005-10-14 14:18 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Hoenig 2005-09-13 08:15:17 UTC
Once a GNOME session is started, two DBUS session buses are running. One session bus is started 
by /etc/X11/xinit/xinitrc the other by GNOME:

tsh      20539  0.0  0.2   3408  1280 ?        Ss   12:12   0:00 dbus-daemon --fork --print-pid 8 --print-
address 6 --session
tsh      20540  0.0  0.1   2720   736 ?        S    12:12   0:00 /usr/bin/dbus-launch --sh-syntax --exit-
with-session /usr/X11R6/bin/gnome
tsh      20557  0.0  0.1   2716   740 ?        S    12:12   0:00 /usr/bin/dbus-launch --exit-with-session /
opt/gnome/bin/gnome-session
tsh      20558  0.0  0.2   3832  1400 ?        Ss   12:12   0:00 dbus-daemon --fork --print-pid 8 --print-
address 6 --session
Comment 1 Andreas Jaeger 2005-09-13 08:51:43 UTC
GNOME should not start it's on session bus!  With 9.3 we added the starting
of dbus to xinitrc to make GNOME happy, for details check previous bug reports.
Comment 2 Rodrigo Moya 2005-09-13 09:05:23 UTC
That didn't seem to work, that's why I added the starting of gnome-session
through dbus-launch.
Comment 3 Timo Hoenig 2005-09-13 09:28:53 UTC
I have a solution. Do we want to put this in RC3?
Comment 4 Timo Hoenig 2005-09-13 09:32:24 UTC
Proposed solution:

   * remove "exec /usr/bin/dbus-launch --exit-with-session /opt/gnome/bin/gnome-session" from /
usr/X11R6/bin/gnome
   * change /etc/X11/xinit/xinitrc:

   -    WINDOWMANAGER="$dbuslaunch --sh-syntax --exit-with-session $WINDOWMANAGER"
   +    exec /usr/bin/dbus-launch --exit-with-session /opt/gnome/bin/gnome-session
Comment 5 Timo Hoenig 2005-09-13 09:35:07 UTC
Hum, no, the second part (patch for xinitrc) is wrong I guess
Comment 6 Rodrigo Moya 2005-09-13 09:44:49 UTC
Can't we just keep it in /usr/X11R6/bin/gnome and remove it from the other file?
Comment 7 Timo Hoenig 2005-09-13 09:50:07 UTC
I am not sure whether this would break another windowmanager which relies on xinitrc starting a 
dbus session bus.
Comment 8 Rodrigo Moya 2005-09-13 10:06:45 UTC
Does the dbus-launch started /etc/X11/xinit/xinitrc work as expected in other
WM? Can someone with KDE installed run it and try to run:

$ notify-send Hello

from a terminal in that WM?

The same does not work at all in GNOME for me. Does it work in GNOME (removing
the dbus-launch from /usr/X11R6/bin/gnome) for anyone?

So, if, as I think, it does not work in any WM, no WM can be broken with that
change. If it works, then maybe it's something with my setup, although I tried
it also with newly created users
Comment 9 Timo Hoenig 2005-09-13 10:15:39 UTC
I've just checked a couple of other window managers.

The dbus session bus by xinitrc

  * is useless for KDE (session bus is not running after login, DBUS_SESSION_BUS_ADDRESS is not 
set)
   * is useless for GNOME (session bus is running after login, DBUS_SESSION_BUS_ADDRESS is not 
set)
   * is useful for windowmaker and blackbox (sessuion bus is running after login, 
DBUS_SESSION_BUS_ADDRESS is set
Comment 10 Timo Hoenig 2005-09-13 10:20:08 UTC
notify-send works for me in a gnome session of my RC1 under both conditions:

  * two dbus session buses bus started by xinitrc and gnome
  * one dbus session bus started by gnome
Comment 11 Timo Hoenig 2005-09-13 10:22:31 UTC
Removing dbus-launch from /usr/X11R6/bin/gnome is a very bad idea since GNOME refuses to start at 
all afterwards.
Comment 12 Rodrigo Moya 2005-09-13 10:35:49 UTC
Right, so the dbus-launch command in xinitrc seems useless, except for
windowmaker and blackbox (are they starting, maybe, dbus-launch themselves after
all? Since it does not work for other WM, I'd think so).
Comment 13 Timo Hoenig 2005-09-13 10:43:06 UTC
They do not start dbus-launch or dbus-daemon --session themselves.

I really *think* that the invocation by xinitrc is useless but I'd mark this one as LATER since we have 
no bug reports that the two running session buses under GNOME cause any problems.
Comment 14 Timo Hoenig 2005-09-13 10:51:09 UTC
Andreas could you please comment?
Comment 15 Timo Hoenig 2005-09-13 11:36:55 UTC
Just got my hands on a machine with RC2 and KDE installed which is configured with auto-login. On 
that system there is a session bus running.

This fact should empahsize that we better do _not_ remove dbus-launch from xinitrc at the current 
point of time.
Comment 16 Andreas Jaeger 2005-09-13 11:49:07 UTC
The command in xinitrc is needed so that dbus works under KDE as well, we cannot
change this.  Note that we added this for 9.3 in this place and it worked at
that time for both KDE and GNOME.  Please fix gnome to work with the existing setup.
Comment 17 Rodrigo Moya 2005-09-13 11:54:07 UTC
Does it really work in KDE? That is, does:

$ notify-send Hello

work as expected, showing a notification on the bottom right corner of the screen?

(notify-send is from libnotify package
Comment 18 Timo Hoenig 2005-09-13 11:59:46 UTC
Just re-checked:

My previous statement (comment #9) that no dbus session bus is running under KDE is not correct 
for local users. Hence, we have a sane setup for dbus-session buses for all X sessions but GNOME.

send-notify does work in KDE, too.
Comment 19 Rodrigo Moya 2005-09-13 14:31:53 UTC
Ok, the extra dbus-launch in gnome-session was added because of users having
their own .xinitrc, in which case system-wide xinitrc is not run. So yeah,
removing the dbus-launch in gnome-session and submitting a package...
Comment 20 JP Rosevear 2005-09-13 14:33:15 UTC
I'm not sure we should jam this into RC3.  I think an update with more testing
is appropriate.
Comment 21 Timo Hoenig 2005-09-13 14:35:09 UTC
Careful!

If you simply remove dbus-launch from /usr/X11R6/bin/gnome it will break GNOME completely. I just 
verified this with RC2.
Comment 22 Timo Hoenig 2005-09-13 14:36:17 UTC
JPR: Totally agreed. We have no bug reports that the second dbus session bus does cause any 
harm. I strongly vote for _not_ fixing this for 10.0 now.
Comment 23 Andreas Jaeger 2005-09-13 14:38:18 UTC
Rodrigo and Timo, please test this!

Btw. we added a release note mentioning the local modified xinitrc already. 
This one should take care of it.
Comment 24 Andreas Jaeger 2005-09-13 14:39:07 UTC
Since Timo tested (collision while submitting this) and it failed, let's not do
it for now...
Comment 25 Timo Hoenig 2005-09-13 14:41:45 UTC
aj: Yes. Having two session buses is not "nice" but will not cause any problems to my knowledge 
since only the second session bus will be used by applications.
Comment 26 Rodrigo Moya 2005-09-13 14:43:32 UTC
Tim, how did it break GNOME? I just run with the fixed package, with no problems
at all (for users with no .xinitrc).

And, what exactly did you change in that file?
Comment 27 Timo Hoenig 2005-09-13 14:52:32 UTC
I commented out the line for dbus-launch.

My local test user does not have a .xinitrc (just .xinitec.template).

GNOME refuses to start with the common "your session lasted less than 10 seconds" dialog and has 
the following log:

/etc/X11/xim: Checking wether an input method should be started. INPUT_METHOD is not se ir empty 
(no user selected input method). Trying to start a default input metod for the localte en_US.UTF-8 ...
There is no default input method for the current locale.
Comment 28 Rodrigo Moya 2005-09-13 14:56:30 UTC
Right, you don't have to comment that line, only remove the dbus-launch command
line, so:

- exec /usr/bin/dbus-launch --exit-with-session /opt/gnome/bin/gnome-session
+ exec /opt/gnome/bin/gnome-session
Comment 29 Timo Hoenig 2005-09-13 15:01:32 UTC
Yes, right. Works fine and should not have any side effects in my opinion.

aj: Can we still submit a package for RC3?
Comment 30 Andreas Jaeger 2005-09-13 16:26:53 UTC
Please do.
Comment 32 Rodrigo Moya 2005-09-13 16:32:16 UTC
I can submit the package, since I did the change. Just tell me you approve it,
and I'll submit it immediately
Comment 33 Andreas Jaeger 2005-09-13 16:39:48 UTC
Just talked to JPR and we decided to not check it in for now.  Let's test some
more...
Comment 34 JP Rosevear 2005-09-14 00:37:25 UTC
I do think we can take an update here though once this is tested.
Comment 35 Rodrigo Moya 2005-10-14 14:18:42 UTC
Package submitted to STABLE