[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can't start X apps from su



Yeah, I got annoyed because of this too. Anyway it's not a big problem. What happens when you 'su' is that your env.vars. are changed to root's. Thus, apps don't know where the user's X session is. What you can do is use the -p flag for su. 'su -p' will preserve the user's env.vars. for the invoked su session (or login for 'su -'). Now you can run X apps as root.

If I don't remember it completely wrong, at least Redhat and Mandrake do this by default, so in those distros you don't have to worry about -p, but they might also use some other mechanism. This makes it confusing for someone who's used rh or mdk earlier.

hth,
/johan

Andrej Prsa wrote:
Hello List,

I have a very-difficult-to-reproduce-but-pertaining problem with
accessing X applications (such as nedit) when gaining access via
su from some other user's X session. If I log in as root to X,
such problem never occurs. But as I don't want to take the name
of root in vain, I got used to using su. *Usually* things work,
but suddenly, after an indefinite amount of time, it just doesn't
work any more with the only statement that it cannot connect to
X session. As a side-effect calling mc from su session becomes
miraculously black-and-white. If I close all open terminals,
restart one and go into another session of su, I could sometimes
regain normal su operation and sometimes not. This has been
bugging me since I installed Debian (oh, it's 3.0r1 stable), but
I lived with it until now...

Thanks for your time,

Andrej




--
Johan Ehnberg
johan@ehnberg.net
"Windows? No... I don't think so."



Reply to: