Bugzilla – Bug 266931
dbus-daemon does not end with users sessions and has many instances for each user
Last modified: 2007-10-13 16:38:44 UTC
Note: This is a duplicate of bug #158098 but any attempt to add an additional comment or change the product to 10.2 gets rejected with "You are not permitted to edit bugs in product SUSE LINUX 10.0." This problem described in #158098 certainly still exists in 10.2. I have just killed a few dozen dbus-daemon's on a system with only 3 remote X sessions from thin clients and 1 local X login.
Andreas, can you please provide the complete list of processes running (ps axu) whenever you run into that issue? Thanks!
Created attachment 135979 [details] "ps axu" output Freshly booted 10.2 install. I logged in and out of a fairly standard KDE session 3 times on the local X display (:0). Note that for each login a dbus-daemon gets left behind.
Andreas, thanks for the process list. It looks quite sane -- I can not see any orphan process using D-Bus. Do you happen to have GNOME on your system installed, too? If so, could you please check whether the same happens if you use GNOME sessions instead of KDE? Thanks!
Gnome is not installed on the system I send you the ps output (comment #2) from. However a different system has both KDE and Gnome installed and on this system the same happens for both desktop environments. I am surprised that you can't seem to reproduce this since at least all of my systems show the same problem and they are quite different systems (Opterons, Athlons, and Intel - all dualcore and 64bit) and for all user accounts I tested (including a minimal KDE session setup configured with kiosktool). Each session logout leaves one addiontal dbus-daemon running (100% reproduceable). I have all relevant updates from the 10.2 update tree installed but I am not sure if this already happend with the original DVD install (The server where my thin clients connect only went into production recently and unlike my normal desktops this server sees many temporary X sessions so the many dbus-daemons are really noticeable in the ps output).
Created attachment 137085 [details] ps axu of opensuse 10.2 system with lots of dbus deamons Linux jwt 2.6.18.8-0.1-bigsmp #1 SMP Fri Mar 2 13:51:59 UTC 2007 i686 athlon i386 GNU/Linux -> system runs daily 30 users. the output is when everybody is logged out ->kde is used as default window manager
I consistently see the same behavior on at least two different i86 systems, one of them with a fresh install.
The problem appears to originate in gdm--even when using the KDE desktop--because gdm is used for KDE as long as the GNOME desktop is installed. When I forced the use of kdm by setting DISPLAYMANAGER=kdm in /etc/sysconfig and rebooted, all of the spurious instances of dbus-daemon disappeared.
Sorry for the false lead. I forgot that rebooting would eliminate the spurious dbus-daemon instances. The problem appears with kdm as well.
The problem is caused by loss of the environment variable DBUS_SESSION_BUS_ADDRESS between ending a desktop session and starting a new one. In the case of KDE at least, this can be fixed by saving the value in a per-session file immediately after the session dbus-daemon is created and restoring it when a new session is started. You can do that by adding the following lines near the beginning of /opt/kde3/bin/startkde: # Save the current dbus session bus address echo $DBUS_SESSION_BUS_ADDRESS >~/.dbus-session-bus-address You also need to add the following line before the part of /etc/X11/xinit/xinitrc.common that tests for and starts a session dbus-daemon: # Restore the dbus session bus address if any test -r ~/.dbus-session-bus-address && \ read DBUS_SESSION_BUS_ADDRESS <~/.dbus-session-bus-address export DBUS_SESSION_BUS_ADDRESS There is probably something similar that would work for gnome desktops. A much better solution would be to prevent the environment variable from getting cleared in the first place, but I have not been able to find the code that executes when a desktop session is closed. This bug is NOT specific to x86-64 hardware as reported.
Thanks a lot for investigating, George. Werner, can you please read through the last comments and share your opinion how we should proceed? Thanks!
IMHO saving the DBUS_SESSION_BUS_ADDRESS variable is much better done shortly after the dbus sessin is started. Before this pointer the file should be readed from the file and if there is no session a new one should be started otherwise the old should be used be exporting the existing value. This is similar to what I doing for gpg-agent within /etc/X11/xdm/sys.xsession ... and please avoid using /opt/kde3/bin/startkde I'd like to see this feature also for GNOME and other desktops and even for normal window manaagers.
George, did you have a chance to check whether this issue remains with 10.3? I can not reproduce it on 10.3 Alpha 7.
No reply within more than 4 weeks, fixed in 10.3, marking as FIXED.
Problem still exists in 10.3 final (tested only with kde).
Andreas, can you please send the output of 'ps axu' after killing the session? Thank you.
Created attachment 177403 [details] "ps axu" output I have just found out that my other 10.3 system does not show the problem. However it occurs on my (new installed) main system which has /home copied from the previous 10.2 install. However I see nothing in the "ps axu" output which explains the symptom. The "ps axu output was obtained from a freshly booted systems after 4 login & logouts.
Probably it is because dbus-launch is not being used? What does the output of 'ps axu' look like when you're logged in? There's probably something fishy in your user configuration somewhere in $HOME/.kde .
Created attachment 177424 [details] "ps axu" while logged in Well I already removed everything from ".kde/Autostart" and ".kde/env" but the problem remains. This time the "ps axu" output is after the 3rd login.
OK, I found some time to investigate this issue. It turns out that my old home directory contained an outdated "~/.xinitrc" so the new version in "/etc/X11/xinit/" was not used. After removing it the issue disappeared.