Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#4476 - locale in rc.conf overrides user's own definition

Attached to Project: Arch Linux
Opened by 甘露(Lu Gan) (ganlu) - Tuesday, 18 April 2006, 05:56 GMT
Last edited by Tobias Powalowski (tpowa) - Friday, 21 April 2006, 05:36 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.1 Noodle
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

If I have set "LOCALE=" in the rc.conf, all users have to take it, I don't think it's a good way. System should make user's own locale definition as the first choice if there are any in user's .bashrc, .profile or .xinitrc
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Wednesday, 03 January 2007, 22:40 GMT
Reason for closing:  Not a bug
Comment by Roman Kyrylych (Romashka) - Thursday, 27 April 2006, 14:03 GMT
In current situation if some user wants another locale he/she can override it in his/her .bashrc, .profile, .xinitrc. User can set LANG variable, load another font and keymap with corresponding utils. Is there such a big reason to change current way of locale setting. Right now it works. There were many bugfixes and now current system is stable. Is there such a big reason to change something? How many users on a single machine use different locale than this machine's default?
Comment by 甘露(Lu Gan) (ganlu) - Thursday, 04 May 2006, 11:17 GMT
The problem is that user can't set up another locale in their .bashrc, .profile, .xinitrc, if global rc.conf has been set up.
Comment by Roman Kyrylych (Romashka) - Friday, 05 May 2006, 08:46 GMT
Why?
I just set LANG=en_US in my .bashrc, relogin and
$ locale
LANG=en_US
LC_CTYPE=en_US
LC_NUMERIC=en_US
...
Comment by Roman Kyrylych (Romashka) - Friday, 05 May 2006, 08:48 GMT
Oh, I forgot to add that my default locale is uk_UA.KOI8-U
Comment by 甘露(Lu Gan) (ganlu) - Friday, 05 May 2006, 09:02 GMT
Well, I am not sure, but in my test, if I set locale to en_US.UTF-8 in rc.conf, then my setting of zh_CN.UTF-8 in .profile(I use GDM) will be overrided. I also tried .xinitrc, don't want to set it in .bashrc.
I will try if problem remains without using gdm or using .bashrc.
Comment by Roman Kyrylych (Romashka) - Friday, 05 May 2006, 16:25 GMT
Settings in rc.conf cannot override .profile, .bashrc or .xinitrc _by_design_. It seems that your .profile and .xinitrc are not processed during login. Try to login to text console and check locale.
Comment by 甘露(Lu Gan) (ganlu) - Saturday, 06 May 2006, 05:09 GMT
My .profile does be processed, because I can get a Chinese GUI in gnome without locale setting in rc.conf. Even I can login to text console with right locale, there is problem. This could explain the problem comes from another side, saying gdm?
Comment by Roman Kyrylych (Romashka) - Saturday, 06 May 2006, 06:43 GMT
I don't use gdm, so I can't help you to check if gdm causes the problem. Try to check all sequence of init files from profile to gdm start to track down the problem.
Locale is set in /etc/profile.d/locale.sh
All files from /etc/profile.d/ get executed by /etc/profile
Maybe for some strange reason gdm does this again?

Oh, and yet another - did you generated your locale with locale-gen properly?
Comment by 甘露(Lu Gan) (ganlu) - Monday, 08 May 2006, 11:21 GMT
I know the cause, rc.conf only respects .bashrc, neither .xinitrc. nor .profile, I doubt it's right, since gdm only looks at .profile.
Comment by Roman Kyrylych (Romashka) - Tuesday, 09 May 2006, 09:04 GMT
This is not correct. rc.conf _cannot_ respect or not respect bashrc, .xinitrc, .profile!
.profile is not even read by bash. From bash manpage:
/etc/profile - The systemwide initialization file, executed for login shells
.bash_profile - The personal initialization file, executed for login shells
.bashrc - The individual per-interactive-shell startup file
In Arch Linux default .bash_profile contains only one line: . $HOME/.bashrc

1) I set my locale in rc.conf: LOCALE=uk_UA.KOI8-U
2) rc.sysinit reads $LOCALE and writes export LANG=uk_UA.KOI8-U to /etc/profile.d/lang.sh
3) /etc/profile is executed on user login
4) commands in /etc/profile execudes all /etc/profile.d/*.sh which have execute bit set, so lang.sh will get executed and LANG will be reset according to LOCALE in rc.conf
So, if LOCALE is set LANG from /etc/profile will be overwritten by LANG in /etc/profile.d/lang.sh, which is generated from LOCALE in rc.sysinit!
5) .bash_profile is executed
6) .bashrc is executed

.xinitrc is executed when loading X
.profile is execuded by gdm

Why don't you want to set different locale for each user in .bashrc? You can set it in .bash_profile, if that will make difference.
Comment by 甘露(Lu Gan) (ganlu) - Thursday, 11 May 2006, 13:18 GMT
I don't wanna set different locale in _.bashrc_ (I eventually avoid to do that way), but I do need to set different locale for diffirent user on my system, because I use English but my wife (doesn't understand English and) uses Chinese. so here my problem comes:
.profile is execuded by gdm but rc.conf set locale through /etc/profile.d/lang.sh, then gdm ignores the locale setting in .profile, if I don't set locale in her .bashrc or .bash_profile, otherwise my wife will complain why there's English again.
The other way I can avoid such problem is that I don't use rc.conf to set my global LANG environment (this option is nonsense then, the default locale of Arch is C, but I like utf8 anyway), instead I have to set one by one manually, which _I do think_ is quite annoying if users are over 3.

Loading...