Bug 1031254 - Every reboot, locales in bash are reset to C, need yum reinstall -y glibc-common to get it working again
Every reboot, locales in bash are reset to C, need yum reinstall -y glibc-com...
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Carlos O'Donell
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-16 03:12 EST by Rudd-O DragonFear
Modified: 2016-11-24 10:31 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-09 23:25:58 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rudd-O DragonFear 2013-11-16 03:12:13 EST
Description of problem:

Every time I log into X:

set | grep LANG                                                                                               
GDM_LANG=C
LANG=C

Every time I login to the console, I get a bunch of error messages about setlocale cannot change locale.

Yum reinstall glibc-common fixes it... until next reboot

Both the latest glibc and the previous version have this problem.


Version-Release number of selected component (if applicable):

glibc-2.17-4.fc19.x86_64



How reproducible:

always

Steps to Reproduce:
1. upgrade to latest fedora 19
2. reboot
3. bam

Actual results:

locale is not set in any program


Expected results:


Additional info:
Comment 1 Rudd-O DragonFear 2013-11-16 04:38:22 EST
happens in fedora 20 as well

in X11 (KDE):

locale
LANG=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= 

in the console:

locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
Comment 2 Rudd-O DragonFear 2013-11-16 04:55:08 EST
cat /proc/`pidof startkde`/environ | nul2newline | grep LANG
LANG=C
GDM_LANG=C

but

cat /proc/`pidof gdm`/environ | nul2newline
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LANG=en_US.utf8

wat
Comment 3 Rudd-O DragonFear 2013-11-16 04:59:24 EST
~@karen.dragonfear:
locale
LANG=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=

0 <- locale
~@karen.dragonfear:
su - rudd-o -c locale
Password: 
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 20: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 23: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 26: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 29: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Comment 4 Rudd-O DragonFear 2013-11-16 05:00:51 EST
su - rudd-o -c 'strace -efile -ff locale'
Password: 
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 20: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 23: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 26: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 29: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
execve("/bin/locale", ["locale"], [/* 44 vars */]) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
open("/usr/lib/locale/en_US.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
Comment 5 Rudd-O DragonFear 2013-11-16 05:29:27 EST
localedef -i en_US -c -f UTF-8 en_US.UTF-8

fixes the problems temporarily

the only file it touches is /usr/lib/locale/locale-archive
Comment 6 Carlos O'Donell 2013-11-16 14:55:31 EST
This is really not normal. When you reinstall glibc-common it will install the entire set of locale archives, so you'll get things working. However, it appears that something else in your system is either corrupting or overwriting locale-archive.

Try this:
* Reboot.
* Run `localedef --list-archive'

What does the last step print?
Comment 7 Rudd-O DragonFear 2013-11-16 15:32:33 EST
Nothing. It's empty output.  But the locale-archive file has NOT been corrupted.  It hasn't even been touched since yesterday, when I recreated it with localedef  -i en_US -c -f UTF-8 en_US.UTF-8.
Comment 8 Rudd-O DragonFear 2013-11-16 16:14:34 EST
OK, I have rolled back to my previous upgrade (F19, before I upgraded F19 packages for the last time, and before I upgraded to F20).  I will try to reproduce with a vanilla Fedora 20 and Fedora 19 generated with zfs-fedora-installer.
Comment 9 Carlos O'Donell 2013-11-17 09:13:42 EST
(In reply to Rudd-O DragonFear from comment #8)
> OK, I have rolled back to my previous upgrade (F19, before I upgraded F19
> packages for the last time, and before I upgraded to F20).  I will try to
> reproduce with a vanilla Fedora 20 and Fedora 19 generated with
> zfs-fedora-installer.

The glibc-common install has over 100MB of locale data that it installs by default. Do you have at least 200MB free when you install glibc-common? Without that much free space the locale-archive file might not get created, nor might the other locales be installed, in which case you have only POSIX and C default builtin locales.
Comment 10 Rudd-O DragonFear 2013-11-28 05:36:12 EST
No lack of disk space.

I will try to repro on a vanilla instance.  Otherwise I must assume I have been ruined by an exploit or something similar.
Comment 11 Carlos O'Donell 2013-11-28 14:23:57 EST
(In reply to Rudd-O DragonFear from comment #10)
> No lack of disk space.
> 
> I will try to repro on a vanilla instance.  Otherwise I must assume I have
> been ruined by an exploit or something similar.

It's truly an odd situation. I look forward to hearing if you can reproduce it in a vanilla instance.
Comment 12 Rudd-O DragonFear 2013-12-09 22:59:35 EST
I re-updated.  Same problem.  No lack of disk space.

Anyone else experiencing the same problem?
Comment 13 Rudd-O DragonFear 2013-12-09 23:25:58 EST
I cannot reproduce after running the yum reinstall glibc-common and rebooting.  I added an audit rule, that seems to have stopped the file from being screwed with.  Will reboot after removing the rule, see if that makes a difference.
Comment 14 Carlos O'Donell 2013-12-09 23:29:59 EST
(In reply to Rudd-O DragonFear from comment #12)
> I re-updated.  Same problem.  No lack of disk space.
> 
> Anyone else experiencing the same problem?

This is the first report of such a problem. Your configuration is unique in this respect so far. I can't see anything on our end that would cause this to happen. My best guess would be something in your startup which deletes locales from /usr/lib/locale/locale-archive to save disk space?

Is this a vanilla Fedora 20 install? VM? Real hardware?
Comment 15 Rudd-O DragonFear 2013-12-19 00:07:33 EST
Physical hardware.

Note You need to log in before you can comment on or make changes to this bug.