LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-23-2002, 12:31 PM   #1
jkcunningham
Member
 
Registered: May 2002
Location: Seattle, WA, USA
Distribution: Gentoo
Posts: 136

Rep: Reputation: 15
Problem running emacs when su


I've had this problem off and on for weeks now and can't figure it out.
As a normal user I can run emacs and xemacs without any difficulties. As su I can sometimes run them and sometimes not. At the moment, not. Here's the error message I get when I try:

# emacs
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
emacs: Cannot connect to X server :0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

Does anyone know what's going on here?

Thanks.

jcunningham
 
Old 06-23-2002, 12:48 PM   #2
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
http://sdb.suse.de/sdb/en/html/maddin_xhost.html
 
Old 06-23-2002, 01:22 PM   #3
jkcunningham
Member
 
Registered: May 2002
Location: Seattle, WA, USA
Distribution: Gentoo
Posts: 136

Original Poster
Rep: Reputation: 15
Thanks for the response.

I read the page on xauth and the man entry on xauth, and I think I understand roughly what your getting at. It looks like when I change to su, that su needs to have the authorization key in its xauth file before it is "allowed" to run any x-server applications. Is that correct? Seems like a slightly emasculated super user, but I guess that's beside the point. In any event, how do I do it? It wasn't entirely clear to me, and I'm afraid of breaking something. As su do I run xauth set <32-digit-key-from-xauth-list-as-user> or the other way around?

Seems like a lot of trouble when all I want to do is change my /etc/fstab file without using vi or logging off and logging on as root.

Furthermore, I have exactly the same distro at work (SuSE 8 pro) and emacs runs fine there in su, without ever having screwed with the xauth. What's the difference

Thanks again.
jcunningham
 
Old 06-24-2002, 04:01 AM   #4
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
Start up a terminal window and run:

xhost +localhost

Then you can su to root and run emacs.

Or you can start up a terminal window and run:

xauth list $DISPLAY

This will print out a line that you will need to paste into the line below. su to root and enter:

xauth add <paste the line here>

Then you can run emacs.
 
Old 06-24-2002, 10:00 AM   #5
jkcunningham
Member
 
Registered: May 2002
Location: Seattle, WA, USA
Distribution: Gentoo
Posts: 136

Original Poster
Rep: Reputation: 15
Thank you. I don't know yet if your suggestion will fix the problem or not, for without having done anything (I am aware of) the problem has gone away. Now I can run both emacs and xemacs as su. This has happened before. My guess is that next time I reboot the problem will reoccur. At that point I will try your suggestions.

I'd love to know what causes the change in behavior.

Thanks again.
 
Old 06-24-2002, 08:20 PM   #6
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
You're welcome.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
emacs not running in a windows ttilt Slackware 9 12-01-2004 03:12 PM
running scheme through emacs phoeniks Linux - Software 5 10-18-2004 12:12 AM
running emacs in su mode wont open x window true_atlantis Linux - Software 2 05-05-2004 12:05 AM
problem with running emacs as su jsfour Slackware 2 12-04-2003 01:11 PM
emacs running winDOS programs trough wine or similar software ? jamaso Linux - General 2 11-19-2003 06:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:40 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