environment variable not set when 'su'

environment variable not set when 'su'

Post by Jerry Flemin » Thu, 08 Jun 2006 13:09:29



Hi,

I pub LC_ALL in /etc/environment to set Chinese environment and
everything works fine if I log in normally. But if I log in first with a
different account and 'su -' to my username, the LC_ALL is not set. What
should I do to regain these, without exporting them after each su (maybe
I can source them in ~/.bashrc,)? Anyway, why it is lost?

My /etc/environment:
LANGUAGE="zh_CN.GB2312:en_US:en_GB:en"
LANG=zh_CN.GB2312

export LC_ALL=zh_CN.GB2312
export G_BROKEN_FILENAMES=1

-Jerry

 
 
 

environment variable not set when 'su'

Post by Sven Maschec » Sat, 10 Jun 2006 07:33:57



> I pub LC_ALL in /etc/environment to set Chinese environment and
> everything works fine if I log in normally. But if I log in first with a
> different account and 'su -' to my username, the LC_ALL is not set.

/etc/environment might be read by windowing environments and
your sshd, telnetd or login.  But it's not read by a shell.
Put these settings into a shell profile, preferably one which
is read by a login shell only.  See the paragraph "Invocation"
in your shell manual, use for example .profile or .bash_profile
or the equivalents in /etc/.

Quote:> export LC_ALL=zh_CN.GB2312

LC_ALL is overriding all other categories, you should only need
this for debugging.  Otherwise LANG is the correct category.

 
 
 

1. What's this mean: "USER environment variable could not be set"

Whenever users (as opposed to root) log into our system, they
get this error message:

Warning: USER environment variable could not be set

Any ideas on what this means?

Also, both mail and mailx return:

No mail for ubluit

and the id command doesn't mention the username. Is the "ubluit" thing
some kind of programmers joke? Are these things related?

Thanks,

Daniel A. Segel

--
Daniel A. Segel

2. Blocking user login and su only

3. Environment Variables not functioning for 'system' in awk

4. difference between ipchains and squid

5. 'su ' vs. 'su -'

6. TCP param to increase session timeout?

7. restrict use of 'su' or 'su -'

8. SCSI Timouts & Linux 2.0.36

9. how to set parent's environment variables from shell script?

10. Setting path when doing 'su' to root...

11. Question about path setting after issueing the command 'su'

12. Setting up 'su'

13. When using 'su' -> ttyp0 : Operation not permitted