LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-27-2004, 03:21 PM   #1
lawrencegoodman
Member
 
Registered: Aug 2003
Posts: 47

Rep: Reputation: 15
Root can execute programs


Something wierd is going on with my root. When I log in as root, I can no longer executive programs.

For example, I type in /opt/kde3/bin/kate and get the following error:
kdeinit: Shutting down running client.
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
kded: cannot connect to X server :0.0
ERROR: KUniqueApplication: Registering failed!
ERROR: KUniqueApplication: DCOP communication error!
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
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: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
kate: cannot connect to X server :0.0
ERROR: KUniqueApplication: Registering failed!
ERROR: KUniqueApplication: DCOP communication error!

When I type in /opt/wp8/bin/xwp (for wordperfect), I get the following error:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Error: Can't open display: :0.0
linux:/opt/wp8/wpbin # ./xwp -admin
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Error: Can't open display: :0.0

This must be a permissions problem, right? But how did I take away permissions from root?

Thanks
 
Old 01-27-2004, 03:31 PM   #2
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
type
# set
in a command window and see what DISPLAY says. If it is gone then in a terminal window type;
# DISPLAY=:0.0
# kate
Your display may have gone south. If reboot doesn't fix it, put
export DISPLAY=:0.0
in some startup script.

Of course the '#' are in root's prompt. Do not type these.
 
Old 01-27-2004, 03:36 PM   #3
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
Maybe you have more than one session of X open.
How are you logging in as root?

Are you doing it from within x or
(and this is what it looks like)
have you jumped to a new console and tried to lauch an X program
from a terminal?

Also echo $DISPLAY
should be :0.0
or
machinename.hostname.com:0.0

From within X launch a terminal and su to root.
Should be ok from there.

Hope this helps,
alar
 
Old 01-27-2004, 05:05 PM   #4
lawrencegoodman
Member
 
Registered: Aug 2003
Posts: 47

Original Poster
Rep: Reputation: 15
Thanks, but no luck.

I type set as root and get:
DISPLAY=:0.0

When I type echo $DISPLAY, I get:
:0.0

Some other info if it helps:
1) I am logged in as lawrencegoodman. I open a terminal, do su, and then try to run kate and get those errors.
2) I can type ALT+F2 and type kdesu -- sudo kate and kate will start.
3) I can open up a new session, login as root, and then get kate to work.
4) One thing I have never understood: as a user, I can just type kate and kate will launch. But whenever I am root, I have to type ./opt/kde3/bin/kate or else it says it cannot find kate. I don't quite get why a user has access to the bin files, but not root.
5) I have been tinkering with my fstab folder and put in a usb cdrw device today. I don't see how that would cause this problem, but just in case.
6) I am using Suse 8.2 with KDE 3.1.

Thanks as always for all your help.
Lawrence
 
Old 01-27-2004, 07:06 PM   #5
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
1) Look into vim, joe, pico when you su in a terminal.
4) When you type the set command after su, did you notice that /opt/kde3/bin was not in the PATH. When you type "su" and the password, you do not pickup the root's path. Try "su -" and the password. Yes that is a dash after su. The dash says to use root's path. If suse didn't setup a complete path as you would like, find it and add whatever you need. Every distro I've seen works correctly. Most folks when they "su" in a terminal use vim,joe,pico,etc...
5) You didn't cause any problems doing this. Maybe next time try vim,joe,pico, etc....
6) Good distro. Edit your profile and put suse in there like I have slackware in mine. Then it will show up on the left. Does suse have vim, joe, pico, etc...?

A little hint, some day you are going to have a GUI problem. You are not going to be able to use kate. You are going to have to use a non-GUI text editor. Every distro I seen has vim or vi, most have joe, pico, nano. Learn to use it/them (vim is the best choice), at least in bare bones mode. Doing things like working with fstab is a perfect place to start. vim has a GUI mode also. In terminal and under your name, type gvim and see if it is installed on your distro. It is a GUI version of vim. To be honest, vim is a little different that kate, somewhat tough to get your hands around it, but once you get working with it you should have no problem. You should have the docs. There is a tutor, type vimtutor. Check the web site or google.
 
Old 01-27-2004, 07:14 PM   #6
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
One more thing. In your first post, I took it as you login as root, NOT using su from a terminal window. Try to give a little more details. Your second post should have been included in your first post. Two different things. Confuses the question.

good luck.
 
Old 01-27-2004, 07:30 PM   #7
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Responses in order:

1) Make sure the DISPLAY variable is set to :0.0 after you su. I get errors about not having DCOPserver running, but i'm not in kde and it allows me to start kate.
2) Using kdesu sets up proper communication between the required processes (dcopserver and others, i'd assume) which allows it to work. It's designed specifically for this purpose.
3) That's good, but not good to log into X as root :-D
4) Default paths are different for users and root. (for good reason.) echo $PATH to see the path as a user, then do su or su - or login as root and do the same to see the path for root.
5) fstab would have nothing to do with this and fstab is a file, not a folder.

For what it's worth, I'm using slackware and also cannot open kate from an xterm after su-ing.

Someone else will probably have more complete answers.

Does kdesu work from that xterm ? I'd imagine it would :-D

--Shade
 
Old 01-27-2004, 07:42 PM   #8
FLOODS
Member
 
Registered: Aug 2003
Location: GA
Distribution: Fedora Core 4 Desktop/Server.
Posts: 361

Rep: Reputation: 30
I logged in under user and then used su. Tried to run kate and it worked fine. Didn't have to use /whatever/folder/to/kate, just typed in kate and it worked.. Said segmentation fault at start but kept going and worked fine.. logged out and under normal user worked better with no errors etc..
 
Old 01-27-2004, 08:08 PM   #9
lawrencegoodman
Member
 
Registered: Aug 2003
Posts: 47

Original Poster
Rep: Reputation: 15
Okay, you guys are a godsend. Thanks.

So I login as su - (with the dash), and then I can indeed now just go ahead and type kate, but I get this error:
ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.

I then type echo $DISPLAY and get nothing.

Finally, I type DISPLAY=:0.0 and try kate again, but get the error:
ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.

I also get this error:
Mutex destroy failure: Device or resource busy

And when I type konqueror, I get this error:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
konqueror: cannot connect to X server :0.0

I guess it's a matter of reestablising for roor the path to DISPLAY. But, forgive me, I am not sure how to do that. I also was just wondering if you might explain how, in general, you set paths for a user, i.e. what file I can edit to make these settings permanent.

Thank you for the education.
 
Old 01-27-2004, 08:55 PM   #10
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Before you su to root, try "xhost + localhost" then set your DISPLAY variable as root.
 
Old 01-28-2004, 07:09 AM   #11
lawrencegoodman
Member
 
Registered: Aug 2003
Posts: 47

Original Poster
Rep: Reputation: 15
This works! Thanks. I am just wondering now how I make these settings permanent, i.e.
1) Is there a way I can do su and it remember the paths for su -?
2) How do I make is so xhost = localhost all the time?
3) How do I permenantly reset the path for display for root?

Thanks!
 
Old 01-28-2004, 07:42 AM   #12
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Put the commands in .profile.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute root-privilege programs in KDE autostart? rylan76 Linux - Software 3 07-31-2005 04:40 AM
I can not execute compilied programs guitarfella Fedora 2 04-22-2005 11:45 PM
Programs/Installers won't execute. PLEASE HELP DesyphER Linux - Software 4 03-02-2005 04:01 PM
can xmodmap be used to execute programs? vexer Linux - General 1 10-02-2004 06:26 PM
Programs execute at startup Greg21 Linux - Newbie 5 06-05-2003 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration