You are not logged in.

#1 2009-05-09 22:38:10

yvz
Member
Registered: 2009-05-09
Posts: 21

Kde with sudo problem

Before Kde update, i could use

sudo dolphin

command to explore file systems as a root. But now, when i try dolphin or konqueror as a root user, i get an "xmessage" that says

Could not start ksmserver. Check your installation.

Then, if i close the xmessage window, systems logs me out to kdm login screen. But if i ignore the message and don't touch it, everything seems and works normal. I am really confused about that and need help.

Yavuz

ps : using regular kde

Last edited by yvz (2009-05-09 23:43:26)

Offline

#2 2009-05-09 23:00:00

Kooping Funts
Member
Registered: 2009-03-13
Posts: 6

Re: Kde with sudo problem

I'm having the exact same issue. I'm running KDEmod 4.2 and since the 4.2.3 update, this along with ext hd mounting issues have arisen. Any time I want to mount something with dolphin now I have to run dolphin as root and if I do that I get this message.

Offline

#3 2009-05-09 23:21:38

lunch_box
Member
Registered: 2008-10-21
Posts: 16

Re: Kde with sudo problem

Hey,

I've just tried the same with regular KDE 4.2.3 and I get the same error if running Dolphin with sudo. If you run it with "kdesu dolphin" however, this doesn't seem to happen.

Offline

#4 2009-05-09 23:40:07

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: Kde with sudo problem

It gets worst ... when you try to change the background colours as root and/or perform other activities as root you get:

error.png

Then it fails indicating that the path to the file cannot be found!!

R.

Edit:

BTW I get that error running kdesu systemsettings.

Last edited by ralvez (2009-05-09 23:41:47)

Offline

#5 2009-05-09 23:46:24

yvz
Member
Registered: 2009-05-09
Posts: 21

Re: Kde with sudo problem

I get that Cannot talk error right now while using kdesu dolphin. Kdesu doesn't work for me. Opens the dolphin app without any message but files don't appear.

edit : kdesu dolphin is another issue i guess and looks kind of solved in here

Last edited by yvz (2009-05-10 01:05:35)

Offline

#6 2009-05-10 01:56:39

Kooping Funts
Member
Registered: 2009-03-13
Posts: 6

Re: Kde with sudo problem

Well for me

$ kdesu dolphin
Works fine for now. Huh.

Offline

#7 2009-05-12 03:48:11

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Kde with sudo problem

I have the exact problem also when doing

sudo dolphin

Upon pressing okay, kde breaks on my netbook...I have to restart kdm once again at konsole..:(

I've also tried deleting $./.kde4/share/config/dolphinrc as what I've read...


I hope there would be a solution for this...


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#8 2009-05-12 22:31:02

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: Kde with sudo problem

Instead of "kdesu dolphin" try:

kdesu dbus-launch dolphin

That works for me.

Offline

#9 2009-05-13 02:01:54

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Kde with sudo problem

rune0077 wrote:

Instead of "kdesu dolphin" try:

kdesu dbus-launch dolphin

That works for me.

It does let you run dolphin but as for me upon opening text files this shows up:

KDEInit could not launch '/usr/bin/kate'.

I can't also open .odt files, pictures, music files, and videos....:o

Does someone happen to experience this as well?:(


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#10 2009-05-13 05:54:14

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: Kde with sudo problem

kaola_linux wrote:

Does someone happen to experience this as well?:(

Yes. I experience all three bugs mentioned here. sad

We should file a bug report.

Offline

#11 2009-05-13 08:42:57

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Kde with sudo problem

In the link mentioned in the post #5 a workaround is to use :

xhost +;kdesu dbus-launch dolphin

and

xhost -

when finished with dolphin.

But I agree that there should be another way to run dolphin as root, included natively in KDE.
So it is rather a functionality request to the KDE devs rather than an Arch bug.

Offline

#12 2009-05-13 11:23:37

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: Kde with sudo problem

kaola_linux wrote:
rune0077 wrote:

Instead of "kdesu dolphin" try:

kdesu dbus-launch dolphin

That works for me.

It does let you run dolphin but as for me upon opening text files this shows up:

KDEInit could not launch '/usr/bin/kate'.

I can't also open .odt files, pictures, music files, and videos....:o

Does someone happen to experience this as well?:(

Okay, I tested this, and I get the same result: text-files are not opening. The solution here is to run "kdesu kate" and then open the file from within kate, as root. It works, but yeah, that's a mighty complicated way of doing it and it should be easier.

Offline

#13 2009-05-13 12:55:07

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Kde with sudo problem

rune0077 wrote:

Okay, I tested this, and I get the same result: text-files are not opening.

Have you tried with 'xhost +;' at the beginning of the command, and then opened a text file with kate ?
Because I can open text files without errors, using that workaround.
I can also view pictures or photos by clicking on them.

Offline

#14 2009-05-14 01:47:38

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: Kde with sudo problem

berbae wrote:

But I agree that there should be another way to run dolphin as root, included natively in KDE.
So it is rather a functionality request to the KDE devs rather than an Arch bug.

It really seems to be an upstream bug, but using sudo worked with 4.2.2, so it is definitely a regression, not a feature request.

I found this bug report, wrongly assigned to kate: https://bugs.kde.org/show_bug.cgi?id=192073

Offline

#15 2009-05-14 03:24:07

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Kde with sudo problem

Using sudo (with the default config) to run KDE apps is not a good. sudo by default do not change the $HOME enviroment variable, then when a KDE apps is started with sudo (first start the ksmserver that is the session manager of kde), will try overwrite the perms of files ~/.kde4/ then KDE crash.

For this purposes use "kdesu" or "su", or if insist to use sudo, force to set de the $HOME to the new user.

Offline

#16 2009-05-14 05:52:13

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: Kde with sudo problem

djgera wrote:

Using sudo (with the default config) to run KDE apps is not a good. [...] For this purposes use "kdesu" or "su", or if insist to use sudo, force to set de the $HOME to the new user.

I agree. Only, what you propose does not actually work e.g. with dolphin in KDE 4.2.3 (as opposed to previous releases). Kdesu-launched dolphin is not able to communicate via dbus and thus does not show files or folders at all. Launchin dolphin as root (su) fails completely:

$ su
Password:
[root@archlap]# dolphin
<unknown program name>(9376)/: KUniqueApplication: Cannot find the D-Bus session server

<unknown program name>(9375)/: KUniqueApplication: Pipe closed unexpectedly.

Offline

#17 2009-05-14 13:13:49

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Kde with sudo problem

Ohh no, but you use a simple "su", No, no, a simple "su" does not work, this is because DBUS_SESSION is inherited, without doing a su with login shell. Then dolphin try to contact it, and can not reach it.

In resume, with parameters, for clarification:

using the correct wrapper "kdesu"
using "su" with a login shell "su -"
using "sudo" with changing $HOME sudo -H

Thats all wink Enjoy.

Last edited by djgera (2009-05-14 13:14:27)

Offline

#18 2009-05-15 00:01:02

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: Kde with sudo problem

djgera wrote:

using "sudo" with changing $HOME sudo -H

No luck:

$ sudo -H dolphin
<unknown program name>(7277)/: KUniqueApplication: Cannot find the D-Bus session server
<unknown program name>(7276)/: KUniqueApplication: Pipe closed unexpectedly.
djgera wrote:

using "su" with a login shell "su -"

Hey, this actually works. Thanks! It also made kdesu work correctly. It remains curious, why kdesu would fail before doing this, though.

Offline

#19 2009-05-15 00:52:52

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Kde with sudo problem

If sudo -H don't work, well, ensure what are the enviroment of you get with it. Also ensure what have in the home of other user.

kdesu can work with "su" and "sudo" this depends of you have configured. By default use "su".

Is important that people understand that these type of software that registers especial types of sessions (kde, gnome, dbus, etc), requires especial treatement, using tools that are not designed for that purposes will break it.

This is why applications like policykit exist for doing administratives in desktop.

Good Luck!

EDIT: (sorry my bad english)

Last edited by djgera (2009-05-15 00:53:16)

Offline

#20 2009-05-15 06:46:57

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Kde with sudo problem

Where will I use "sudo -H"? It doesn't work for me..Perhaps a few explainations please? Thanks


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#21 2009-05-15 07:14:59

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Kde with sudo problem

What is does not work?


doing a simple sudo the $HOME do not changed, then your soket files from kde are overwrited by root.

yes is simple:

from konsole (bash login) see how perms are changed, then my kde will crash...

Original perms:

[djgera@gerardo ~]$ ls -l ~/.kde4/socket-gerardo/
total 4
-rw-r--r-- 1 djgera djgera 73 2009-05-15 04:07 KSMserver__0
srw------- 1 djgera djgera  0 2009-05-15 04:07 kdeinit4__0=
srwxr-xr-x 1 djgera djgera  0 2009-05-15 04:07 klauncherMT5193.slave-socket=
[djgera@gerardo ~]$ sudo dolphin
Password:                                                                                                                                                   
Error: "/var/tmp/kdecache-djgera" is owned by uid 1000 instead of uid 0.                                                                                    
Error: "/tmp/kde-djgera" is owned by uid 1000 instead of uid 0.   
blah + blah.... then dolphin starts

Then a xmesage apears "Could not start ksmserver. Check your installation." and... "Buckle your seat belt, Dorothy, cuz KDE is going bye-bye" smile

now see what happens in sockets...

[djgera@gerardo ~]$ ls -l ~/.kde4/socket-gerardo/
total 4
-rw-r--r-- 1 djgera djgera 73 2009-05-15 04:07 KSMserver__0
srw------- 1 root   root    0 2009-05-15 04:10 kdeinit4__0=
srwxr-xr-x 1 djgera djgera  0 2009-05-15 04:07 klauncherMT5193.slave-socket=
srwxr-xr-x 1 root   root    0 2009-05-15 04:10 klauncherMT5326.slave-socket=

This is BAD!

[djgera@gerardo ~]$ lsof -n | grep DEL
kded4     5195 djgera  DEL    REG        8,5            154945 /var/tmp/kdecache-djgera/ksycoca4
kded4     5195 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
kded4     5195 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
ksmserver 5202 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
ksmserver 5202 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
kwin      5204 djgera  DEL    REG        8,5            154945 /var/tmp/kdecache-djgera/ksycoca4
kwin      5204 djgera  DEL    REG        0,7           1015808 /SYSV00000000
knotify4  5207 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
knotify4  5207 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
plasma    5208 djgera  DEL    REG        8,5            154945 /var/tmp/kdecache-djgera/ksycoca4
plasma    5208 djgera  DEL    REG        8,5            154955 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
plasma    5208 djgera  DEL    REG        8,5            154953 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
nepomukse 5213 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
nepomukse 5213 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
kaccess   5215 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
kaccess   5215 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
krunner   5224 djgera  DEL    REG        8,5            154945 /var/tmp/kdecache-djgera/ksycoca4
krunner   5224 djgera  DEL    REG        8,5            154955 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
krunner   5224 djgera  DEL    REG        8,5            154953 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
kmix      5228 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
kmix      5228 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
knotes    5230 djgera  DEL    REG        8,5            154945 /var/tmp/kdecache-djgera/ksycoca4
knotes    5230 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
knotes    5230 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
konsole   5235 djgera  DEL    REG        8,5            154952 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
konsole   5235 djgera  DEL    REG        8,5            154951 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
python    5236 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
python    5236 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index
kwrite    5250 djgera  DEL    REG        8,5            154945 /var/tmp/kdecache-djgera/ksycoca4
kwrite    5250 djgera  DEL    REG        8,5            154943 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.data
kwrite    5250 djgera  DEL    REG        8,5            154942 /var/tmp/kdecache-djgera/kpc/kde-icon-cache.index

thats all, will press OK, then my KDE will say bye-bye.....

Last edited by djgera (2009-05-15 07:17:17)

Offline

#22 2009-05-15 07:27:19

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Kde with sudo problem

BTW: if don't work, ensure to clean all KDE caches, for both users: your user and root. This is: files under ~/.kde4/{cache,socket,tmp}-$HOSTNAME, also clean the symlinks.

Offline

#23 2009-05-15 08:23:42

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Kde with sudo problem

So the only to avoid this error error:

Could not start ksmserver. Check your installation.

is to avoid doing sudo on dolphin?

Is there anyway to avoid putting the dbus-launch upon doing kdesu dolphin over and over again?

I'm really confused about this problem, it even made me reinstall. sad


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#24 2009-05-15 20:21:21

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Kde with sudo problem

Rare, please be more descriptive.

how start your kde? what commands use and where? what are your configuration files? do you clean temp files of kde?, what files have root relative to kde and your user?

All information is valuable. wink

PD: reinstall? No This not is a M$ OS. big_smile

Last edited by djgera (2009-05-15 20:22:15)

Offline

#25 2009-06-21 08:15:34

scarecrow
Member
From: Greece
Registered: 2004-11-18
Posts: 715

Re: Kde with sudo problem

If, for some reason, you want to stick to your sudo settings, and not using kdesu, then build and use "kdesudo" from AUR.


Microshaft delenda est

Offline

Board footer

Powered by FluxBB