Bug 245641 - "Session bus not found" when starting a KApplication via ssh
Summary: "Session bus not found" when starting a KApplication via ssh
Status: CONFIRMED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 235272 244893 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-24 14:56 UTC by Thorsten Staerk
Modified: 2016-06-10 01:53 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Staerk 2010-07-24 14:56:23 UTC
Version:           CVS (using Devel) 
OS:                Linux

Whenever I try to start a KApplication via ssh on another computer, I get
"Session bus not found". I could circumvent this problem with a command 
 export $(dbus-launch)
but I think this should work by default.

So this is a request to put the following patch into kdelibs:
itchy:~/kdelibs/kdeui/kernel # svn diff
Index: kapplication.cpp
===================================================================
--- kapplication.cpp    (revision 1152998)
+++ kapplication.cpp    (working copy)
@@ -508,10 +508,10 @@
   extern void qDBusBindToApplication();
   qDBusBindToApplication();
   QDBusConnectionInterface *bus = 0;
-  if (!QDBusConnection::sessionBus().isConnected() || !(bus = QDBusConnection::sessionBus().interface())) {
-      kFatal(101) << "Session bus not found" << endl;
-      ::exit(125);
-  }
+  //if (!QDBusConnection::sessionBus().isConnected() || !(bus = QDBusConnection::sessionBus().interface())) {
+  //    kFatal(101) << "Session bus not found" << endl;
+  //    ::exit(125);
+  //}

   extern bool s_kuniqueapplication_startCalled;
   if ( bus && !s_kuniqueapplication_startCalled ) // don't register again if KUniqueApplication did so already



Reproducible: Always

Steps to Reproduce:
1. ssh -X somecomputer
2. ktimetracker

Actual Results:  
itchy:~/kdelibs/kdeui/kernel # ktimetracker
ktimetracker(11834): Session bus not found

KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = ktimetracker path = /usr/local/bin pid = 11834
KCrash: Attempting to start /usr/local/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde/socket-itchy/kdeinit4_localhost_10

[1]+  Stopped                 ktimetracker


Expected Results:  
ktimetracker starts
Comment 1 Marco Poletti 2010-09-10 16:46:27 UTC
https://bugs.kde.org/show_bug.cgi?id=244893 is a duplicate of this bug.
Someone with the appropriate permissions should mark it as a duplicate.
Comment 2 Felix Geyer 2010-09-22 18:36:27 UTC
*** Bug 244893 has been marked as a duplicate of this bug. ***
Comment 3 Andreas Pietzowski 2011-02-14 23:08:15 UTC
Please fix this long existing bug. It is really annoying not getting any KDE window to a Mac screen with ssh -X!

Many thanks to the fixer :)
Andreas
Comment 4 Andreas Pietzowski 2011-02-14 23:09:25 UTC
Please fix this long existing bug. It is really annoying not getting any KDE window to a Mac screen with ssh -X!

Bug still exists in KDE 4.6.

Many thanks to the fixer :)
Andreas
Comment 5 Jekyll Wu 2012-01-02 03:05:05 UTC
*** Bug 235272 has been marked as a duplicate of this bug. ***
Comment 6 Rigo Wenning 2012-05-20 17:38:42 UTC
As seen in https://bugs.kde.org/show_bug.cgi?id=235272 (now marked as a duplicate of this one) the command $ export $(dbus-launch) solves the immediate issue. But it creates another one. Since KDE 4.8.2 (4.8.2) "release 494" (OpenSuse), the starting of the remote application results in very high CPU usage of the sshd daemon. After Googling a while I found another bug
http://www.mail-archive.com/rsync@lists.samba.org/msg25466.html where it looks like the CPU usage by the sshd may be due to ssh not knowing where to send stuff. I also noted with ssh -vv that every mouse movement over the remotely started application causes massive redrawings that create the load on the sshd. This wasn't the case in KDE 4.7.4 BTW. Looks like a bug in KDE as starting normal X-Windows programs remain unaffected by that bug and do not create such a high load on the CPU, even on mouse over.
Comment 7 EMR_Kde 2016-06-10 01:53:43 UTC
Using 5.5.1 here