Am Montag 07 Januar 2008 15:02:34 schrieb Nicolas FRANCOIS:
> Hi.
Hello,
>
> I'm having some difficulties with env variables. I got the /etc/profile
> and all stuff OK. I noticed a while ago that if I wanted a su session to
> read those files, I had to do a "su -". So far, so good.
>
> The problem is, this "su -" don't pass env variables set by the normal
> user. 
That's expected behaviour of the '-' parameter. You can just use 'su' to keep 
the regular user's environment. You'll have to add several */sbin directories 
to the PATH variable then.
> I think in particular of the DISPLAY variable : even if I put 
>
> export DISPLAY=localhost:0.0
> xhost +
>
> in my /home/nico/.bash_profile, and then "su -", I can't launch an X
> program in the su session.
>
> What can I do to solve this ? It's quite annoying :-(
Use 'sux'. That's a shell script acting as a wrapper around su. 
Homepage: http://sourceforge.net/projects/sux/

Just copy it into a directory contained in your environment's PATH and chmod 
it +x .

Upon first start it will create a .Xauthority file in /root and it also sets 
the DISPLAY environment variable everytime. No xhost is needed.

As a normal user you use 'sux' just like 'su'. Something like 'sux -' does not 
work however.
>
> \bye
good luck

Andreas Leuner
>
> --
>
> Nicolas FRANCOIS                      |  /\
> http://nicolas.francois.free.fr       | |__|
>                                     X--/\\
> We are the Micro$oft.                 _\_V
> Resistance is futile.
> You will be assimilated.         darthvader penguin


-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to