Bug 277249 - Applications are unable to launch as root
Summary: Applications are unable to launch as root
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdecore (show other bugs)
Version: 4.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 00:24 UTC by Steven Sroka
Modified: 2018-11-06 15:48 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 Steven Sroka 2011-07-07 00:24:05 UTC
Version:           4.0 (using KDE 4.6.4) 
OS:                Linux

Apparently, Oxygen is causing applications on openSUSE to fail to launch.

This is a new bug report (now) properly assigned against Oxygen. Below I will provide all relevant, existing bug reports.

Reproducible: Always

Steps to Reproduce:
$ su -
$ dolphin

Actual Results:  
If you are running openSUSE 11.3 or earlier, the application should fail to load. If you are using openSUSE 11.4 or greater the application will load only because the openSUSE developers have forced another style to be used instead (if the user's default style is Oxygen).

See https://bugzilla.novell.com/show_bug.cgi?id=656144#c21

Expected Results:  
Applications will run as root and they will respect the users preferences in style.

See bug reports:

https://bugs.kde.org/show_bug.cgi?id=199209
https://bugs.kde.org/show_bug.cgi?id=165268
https://bugzilla.novell.com/show_bug.cgi?id=514056
https://bugzilla.novell.com/show_bug.cgi?id=656144
Comment 1 Hugo Pereira Da Costa 2011-07-07 08:29:25 UTC
To be honest, I'll need a summary here.
Pointing me to five long (sometimes inconsistent, sometimes incorrect, and sometimes partially redundant) bug report doesn't help, and I don't know where to start (not even sure that I actually understand the issue).

Thx.
Comment 2 Malvern Star 2011-07-20 10:50:09 UTC
OK, this is a little complicated to explain, so bear with me. Steven, myself and others have been having issues starting KDE applications as super-user.  This seems to fail for some unexplained reason to do with DBUS/Oxygen, so this bug has been filed to try to amalgamate all the related reports.

First, and most simply, opening up a bash terminal, becoming super-user and attempting to launch various KDE applications from the command line does NOT work.  By way of illustration, consider the following behaviour on a system running openSuSE 12.1 Milestone 3 with KDE 4.6.5:

Open a bash terminal and use the command "su" become super user.  Supply password when prompted.  Attempt to launch kwrite using the command "kwrite".  The following feedback is given, and Kwrite crashes:

--------------------
kwrite(5832): Session bus not found 
To circumvent this problem try the following command (with Linux and bash) 
export $(dbus-launch) 

KCrash: Application 'kwrite' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-knet5/kdeinit4__0

[1]+  Stopped                 kwrite
--------------------

Likewise, if using the command "su -" to become superuser instead, as suggested in KDE bug report 199209, similar system feedback is given, and Kwrite crashes:


--------------------
kwrite(6044): Session bus not found 
To circumvent this problem try the following command (with Linux and bash) 
export $(dbus-launch) 

KCrash: Application 'kwrite' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-knet5/kdeinit4__0

[1]+  Stopped                 kwrite
--------------------

Kwrite is not the only application that fails to launch.  Take Dolphin as a further example.  Becoming super-user using the command "su" and then attempting to launch dolphin using the command "dolphin" yields the following feedback:

--------------------
unnamed app(5869): KUniqueApplication: Cannot find the D-Bus session server:  "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." 

unnamed app(5868): KUniqueApplication: Pipe closed unexpectedly. 
--------------------

The only way to successfully launch Dolphin with super-user privileges is to use the link in KMenu provided by openSuSE, which issues the command:
dbus-launch dolphin %i -caption "%c" "%u"

On running this, Dolphin DOES launch, but first displays errors stating that the file dolphinrc is not writeable.  When it launches, it also does NOT use the user-specified desktop theme.  It appears to use a different "default" theme.  The reason for this, as claimed by the openSuSE team is some "difficulties" (unspecified) that they had with Oxygen.  In fact, all KDE applications launched as super-user appear to use a different theme from the user's desktop, including openSuSE's YaST configuration software.

In any case, continuing with the behaviour of KDE, once Dolphin has been launched as super-user using the dbus-launch method described above, attempting to right-click on text files and select "Open With -> Kwrite" will often (but not always) fail.  Sometimes the text file will open immediately, sometimes it will open after a long pause, and sometimes the operation will pause and then fail to open and display the error message: 

--------------------
KLauncher could not be reached via D-BUS. Error when calling start_service_bt_desktop_path: 
The name org.kde.klauncher was not provided by any .service files
--------------------

As you can see, there appears to be a serious issue with KDE that has been present since the full launch of KDE4.  The problem has plagued openSuSE users, but does not appear to be specific to that distro.

Please let both Steven and I know if you need more information, Hugo.
Comment 3 Thomas Zander 2011-07-20 11:22:02 UTC
Notice that I can not confirm this bug; it seems to work the way its suppost to. All apps start just fine.
I'm guessing that this is either a distro bug (dbus auto-start doesn't work) or a setup issue.
Not a KDE issue.
Comment 4 Hugo Pereira Da Costa 2011-07-20 12:53:40 UTC
Hello,
thanks for the summary.
Now my experience is:
1/ running su, then kwrite, dolphin and others indeed crashes
2/ but it crashes whether oxygen or any other style (plastique, cleanlooks)
3/ it does *not* crash when using Qt only applications (e.g. qt designer, /usr/lib/qt4/bin/pixeltool, quassel), this whether you use oxygen or not.

So that I fail to see how this is related to Oxygen in anyway.
In fact I would tend to believe it is more related to kapplication (because of 3).

To comment #3, well crashes also happen here, with Mageia 1. (and kde from trunk), with the limitations above.

Maybe your distribution is the one that succesfully patched the issue :) 

Thus re-assigning.
Comment 5 Malvern Star 2011-07-20 12:57:47 UTC
Thankyou Hugo.  It was instructed to file this under Oxygen for some reason, though I do not recall why.  Hopefully we can get to the bottom of this.  I will do my best to test for you, though any code contributions by me would most likely be harmful rather than helpful.
Comment 6 Martin Schlander 2011-07-20 15:59:36 UTC
This is all quite confusing.

SUSE employees crippled openSUSE, citing an upstream bug regarding Oxygen and d-bus when running applications as root. But obviously never bothered to report this alleged problem upstream. So the status is now that openSUSE packages are crippled, and noone seems to know why...

Maybe Will Stephenson can shed some light on it when his parental leave ends about a month from now.
Comment 7 Bruno Friedmann 2011-09-06 06:02:14 UTC
As small patch is to place in /root/.bashrc (was given by Will)

#Fix kde dbus things
eval `dbus-launch --auto-syntax`

I always start root jobs by using su -l in a konsole.
I've also fix manually all root env to be set almost like my user env. Same win decoration, fonts etc. just a more red light theme to differentiate them.
Comment 8 Roger Luedecke 2011-11-26 16:02:51 UTC
This is still a problem in 12.1. I had assumed for some time that it wasn't supposed to work in such a fashion, and that kdesu was the proper means.

http://paste.opensuse.org/34742236
Comment 9 Andrew Crouthamel 2018-11-06 15:13:36 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bruno Friedmann 2018-11-06 15:48:23 UTC
The distribution version involved here are long time out of maintenance.
So closing.