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

Re: [Partially solved] Re: Locale errors




On Apr 13, 2009, at 3:40 AM, Bob Cox wrote:

On Sun, Apr 12, 2009 at 20:24:27 -0700, Kelly Clowers (kelly.clowers@gmail.com ) wrote:

On Sun, Apr 12, 2009 at 20:14, Celejar <celejar@gmail.com> wrote:

<snip>

So you seem to be correct; for some reason, in the sudo shell, the LC*
variables are getting extra quotes.  Any idea why?  [There's nothing
that looks interesting in root's '.bashrc'; it's basically empty.]

Something to do with the preservation or lack thereof of environmental
variables in sudo? Try putting the env vars in root's .bashrc, maybe?

I don't really know, I use straight "sudo $command" not "sudo -i"

Just a thought: you have anything in /etc/environment ?

On one box here I have:

$ cat /etc/environment
LANG=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8
LC_ALL=en_GB.UTF-8
LC_TYPE=en_GB.UTF-8

(which, as far as it goes, matches the output of the 'locale' command).

I *think* I added that by hand to fix a similar problem to the one being
discussed but cannot remember now.

I modified /etc/environment long ago (long before this problem started) as follows.

rbthomas@greybox:~$ cat /etc/environment
LANG="C"
LANGUAGE="C"
rbthomas@greybox:~$ diff /etc/environment /etc/environment.ORIG
1,2c1,2
< LANG="C"
< LANGUAGE="C"
---
> LANG="en_US"
> LANGUAGE="en_US:en_GB:en"

For comparison...

rbthomas@greybox:~$ locale
LANG=C
LANGUAGE=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
rbthomas@greybox:~$

The problem started after a recent bunch of upgrades. I have no good way of telling which one caused it.


On Apr 13, 2009, at 7:10 AM, Vincent Lefevre wrote:

Could you run the following command as root?

 grep -r 'LANG="en_US.UTF-8"' /etc /root

Perhaps one of the config files has LANG="en_US.UTF-8", which should
be normally interpreted by the shell, but some other tool dealing with
the environment (perhaps PAM-related) does that wrong.



Note that the changes to /root/.bashrc are added by me to work around the problem.


rbthomas@greybox:~$ sudo -i
greybox:~# grep -r 'LANG=' /etc /root
/etc/default/gdm:#LANG=
/etc/default/locale:#LANG=en_US
/etc/default/locale:LANG=C
grep: /etc/alternatives/gnome-text-editor: No such file or directory
grep: /etc/alternatives/java.1.gz: No such file or directory
/etc/init.d/pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/init.d/pcscd:eval LANG=$value
/etc/init.d/exim4:LANG=C
/etc/init.d/mountoverflowtmp:   if LANG=C LC_ALL=C mount | \
grep: /etc/rc0.d/K20inetd: No such file or directory
/etc/rc0.d/K20exim4:LANG=C
/etc/rc0.d/K50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc0.d/K50pcscd:eval LANG=$value
/etc/rc0.d/K63mountoverflowtmp: if LANG=C LC_ALL=C mount | \
grep: /etc/rc1.d/K20inetd: No such file or directory
/etc/rc1.d/K20exim4:LANG=C
grep: /etc/rc1.d/K20festival: No such file or directory
/etc/rc1.d/K50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc1.d/K50pcscd:eval LANG=$value
grep: /etc/rc2.d/S20inetd: No such file or directory
/etc/rc2.d/S20exim4:LANG=C
grep: /etc/rc2.d/S20festival: No such file or directory
/etc/rc2.d/S50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc2.d/S50pcscd:eval LANG=$value
grep: /etc/rc3.d/S20inetd: No such file or directory
/etc/rc3.d/S20exim4:LANG=C
grep: /etc/rc3.d/S20festival: No such file or directory
/etc/rc3.d/S50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc3.d/S50pcscd:eval LANG=$value
grep: /etc/rc4.d/S20inetd: No such file or directory
/etc/rc4.d/S20exim4:LANG=C
grep: /etc/rc4.d/S20festival: No such file or directory
/etc/rc4.d/S50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc4.d/S50pcscd:eval LANG=$value
grep: /etc/rc5.d/S20inetd: No such file or directory
/etc/rc5.d/S20exim4:LANG=C
grep: /etc/rc5.d/S20festival: No such file or directory
/etc/rc5.d/S50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc5.d/S50pcscd:eval LANG=$value
grep: /etc/rc6.d/K20inetd: No such file or directory
/etc/rc6.d/K20exim4:LANG=C
/etc/rc6.d/K50pcscd:value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
/etc/rc6.d/K50pcscd:eval LANG=$value
/etc/rc6.d/K63mountoverflowtmp: if LANG=C LC_ALL=C mount | \
/etc/rcS.d/S37mountoverflowtmp: if LANG=C LC_ALL=C mount | \
/etc/environment:LANG="C"
grep: /etc/fonts/conf.d/30-debconf-no-bitmaps.conf: No such file or directory
/etc/environment.ORIG:LANG="en_US"
/etc/gdm/XKeepsCrashing:  LANG=C
grep: /etc/ssl/certs/ Verisign_Class_1_Public_Primary_OCSP_Responder.pem: No such file or directory grep: /etc/ssl/certs/ Verisign_Class_2_Public_Primary_OCSP_Responder.pem: No such file or directory grep: /etc/ssl/certs/ Verisign_Class_3_Public_Primary_OCSP_Responder.pem: No such file or directory grep: /etc/ssl/certs/Verisign_Secure_Server_OCSP_Responder.pem: No such file or directory
grep: /etc/ssl/certs/spi-ca.pem: No such file or directory
grep: /etc/ssl/certs/SPI_CA_2006-cacert.pem: No such file or directory
grep: /etc/ssl/certs/SPI2007-ca.pem: No such file or directory
grep: /etc/resolvconf/run: No such file or directory
/root/.bashrc:LANG=C
/root/.bash_history:LANG=C
/root/.bash_history:LANG=C
/root/.bash_history:LANG=C
greybox:~# logout


Hope this helps!

Rick


Reply to: