PDA

View Full Version : su doesn't work correctly



Zeffel
03-10-2005, 02:21 PM
Hello, I hope someone can help me (=newbie) with this problem:
I installed Knoppix on my HD and everything seems to be fine, except the following:
When I'm logged on as a normal user and type "su" in a terminal to become superuser it seems to work. But when I try to start a program like Kate, the program doesn't start, but I get this output:

root@scully:/home/tim# kate
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kded: cannot connect to X server :0.0
DCOP aborting call from 'anonymous-1167' to 'kded'
kded: ERROR: Communication problem with kded, it probably crashed.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kdeinit: Can't connect to the X Server.
kdeinit: Might not terminate at end of session.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kate: cannot connect to X server :0.0
kate: ERROR: KUniqueApplication: Registering failed!
kate: ERROR: Communication problem with kate, it probably crashed.
root@scully:/home/tim# Mutex destroy failure: Das Gerät oder die Ressource ist belegt

When I log on as root, everything works fine.

tom p
03-10-2005, 07:43 PM
expected behaviour, not su's fault.

su doesn't have any knowledge about X11, it's simply a command line tool. There are several ways to start X11 programs from the command line as user root:
* before issueing "su" enter "xhost local:" and as user root enter "export DISPLAY=:0"
* open the root shell from the KNOPPIX menu - this will merge the X11 magic cookie (that's needed to connect to the X11 server) into the root shell "environment".

BTW: this has been posted several times. If you'd have searched a little you would have found it and had not to wait for an answer.

Thomas

Zeffel
03-10-2005, 08:55 PM
Ok, that works, thank you.
Well, I did a search, but didn't find anything useful.

Is there a way to make this permanent? It's quite unhandy to type this everytime.
I did a search on this and even found a thread about it (http://www.knoppix.net/forum/viewtopic.php?t=17347&highlight=su+x11), but that doesn't work.

Markus
03-10-2005, 10:17 PM
The post in "Tips and Tricks" is supposed to make it permanent. Did you logout and login again after making the file under ~/.kde/Autostart and are you using KDE?

Zeffel
03-11-2005, 12:20 AM
Oh, I found out what was wrong: I hadn't tagged the .sh file in the Autostart folder as executable!
Now it works. :D Thanks for you post in Tips & Tricks, Markus.