Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
locale problem (locale-archive file replaced?)[SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Jun 18, 2009 3:27 pm    Post subject: locale problem (locale-archive file replaced?)[SOLVED] Reply with quote

Hello,


====== long story short ======
| running locale-gen creates a file /usr/lib/locale/locale-archive with the new available locales, but for a not yet known reason, this file is replaced during | reboot (or when shutting down who knows?).
| I'd like to understand why this file is replaced, by what, and how I can prevent that from happening?
====== /long story short ======



I had to reinstall my system on a new HD (the old one beeing dead..), I have a weird problem with my locales, after every reboot, the only locales available are
Code:
locale -a
locale -a
C
POSIX


LC_* is not defined anywhere, I just have LANG=en_US.UTF-8 in /etc/profile.env

to be even more precise, here is what I get after a reboot:
Code:
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
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=


locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX


But here is my /etc/locale.gen,
Code:
grep -v ^# /etc/locale.gen

en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8
fr_FR@euro ISO-8859-15


And, once I run locale-gen, everything is back to normal, but it's just not right!

Any idea?

TIA
_________________
The End of the Internet!


Last edited by truc on Thu Jun 25, 2009 3:34 pm; edited 3 times in total
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1129
Location: Romania

PostPosted: Fri Jun 19, 2009 4:18 am    Post subject: Reply with quote

Do you have a locale file in env.d?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Jun 19, 2009 8:31 am    Post subject: Reply with quote

Wel, I wasn't clear enough, this is what I have:
Code:
grep -E '(LC_|LANG)' /etc/env.d/*
/etc/env.d/02locale:export LANG='en_US.UTF-8'


Which result in
Code:
grep -E '(LC_|LANG)' /etc/profile.env
export LANG='en_US.UTF-8'



This setting fails to load at each boot since I don't have the appropriate locale available (see above the output of locale -a)

Once I run locale-gen, everything is ok, but, I shouldn't not need to do that?!
_________________
The End of the Internet!
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1129
Location: Romania

PostPosted: Fri Jun 19, 2009 9:52 am    Post subject: Reply with quote

Add
Code:
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"

to /etc/env.d/02locale

Code:
eselect env update


Last edited by sebaro on Fri Jun 19, 2009 10:09 am; edited 1 time in total
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Jun 19, 2009 10:07 am    Post subject: Reply with quote

Well, setting LC_ALL automatically sets LC_*, and settings LANG automatically sets LC_ALL, so I should not need that anyway.

But you're missing my point, setting LANG the way I did work (see above the output of locale after the reboot), but the requested locale is not available (not listed in locale -a, see above).

I have to run locale-gen it order to have it.
_________________
The End of the Internet!
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1129
Location: Romania

PostPosted: Fri Jun 19, 2009 10:31 am    Post subject: Reply with quote

Set LC_* and update env. Just try it.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Jun 19, 2009 12:15 pm    Post subject: Reply with quote

sebaro wrote:
Set LC_* and update env. Just try it.


Well, guess what? Didn't work!
just after booting:
Code:
 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
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=

Code:
 locale-a
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_COLLATE to default locale: No such file or directory
C
POSIX


As you can see, en_US.utf8 is not available, and this is actually my problem, running locale-gen fixes it, but I don't know why
_________________
The End of the Internet!
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1129
Location: Romania

PostPosted: Fri Jun 19, 2009 2:49 pm    Post subject: Reply with quote

You are right :oops: .
locale-gen/localedef generates a locale-archive file in /usr/lib/locale
if I remove that file I'm getting the same errors as you
then a locale-gen and all's fine
do you have that file after reboot?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Sat Jun 20, 2009 11:19 am    Post subject: Reply with quote

This is weird!

after running locale-gen,
Code:
cp /usr/lib/locale/locale-archive{,.old}
md5sum /usr/lib/locale/locale-archive{,.old} ~/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /usr/lib/locale/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /usr/lib/locale/locale-archive.old
10b67a6fe3150a0f95b8e8ac944e5f52  /root/locale-archive
Then on next reboot
Code:
md5sum /usr/lib/locale/locale-archive{,.old} ~/locale-archive
d18ca9312eded85c57062f77b039948f  /usr/lib/locale/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /usr/lib/locale/locale-archive.old
10b67a6fe3150a0f95b8e8ac944e5f52  /root/locale-archive


As you can see, /usr/lib/locale/locale-archive.old is still there (it get deleted by running locale-gen), this means the file /usr/lib/locale/locale-archive has been changed with an different utility than locale-gen!

I've tried to find a file in my / having the same size as the new /usr/lib/locale/locale-archive, but nothing.
I'm now trying to see where localedef (used in locale-gen) could have been used when booting.

If you have any idea, please let me know!

Thanks for your help :)
_________________
The End of the Internet!
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1129
Location: Romania

PostPosted: Sat Jun 20, 2009 4:07 pm    Post subject: Reply with quote

Quote:
I'm now trying to see where localedef (used in locale-gen) could have been used when booting.
If you have any idea, please let me know!

I couldn't find anything. I checked conf.d, init.d, rc scripts.
You can try removing all init scripts from default runlevel and run them yourself. Maybe one of them is creating the issue.
Or you can make the locale-archive file read-only.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Sun Jun 21, 2009 5:46 pm    Post subject: Reply with quote

I tried setting the file read-only but it didn't work.


The funny thing is that the new locale-archive file is not even the same on every boot:
Code:
> cat reboot
d18ca9312eded85c57062f77b039948f  /usr/lib/locale/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /usr/lib/locale/locale-archive.old
> cat reboot2
61af608a8dc7071a313754c5a5d78f91  /usr/lib/locale/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /root/locale-archive
> cat reboot3
a4b2df9c99d5e46372d1c2f8f6b28092  /usr/lib/locale/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /root/locale-archive
> cat reboot4
08c777fa18e651d11e8c122f7195f4cc  /usr/lib/locale/locale-archive
10b67a6fe3150a0f95b8e8ac944e5f52  /root/locale-archive



Just after the boot, running locale-gen -u throws out an error with localedef
Code:
* Generating 2 locales (this might take a while) with 1 jobs
*  (1/2) Generating en_US.UTF-8.../usr/sbin/locale-gen: line 264:  2676 Segmentation fault      "${DESTDIR}"usr/bin/localedef ${LOCALEDEF_OPTS} -i "${input}" -f "${charmap}" -A "${ALIAS}" --prefix "${DESTDIR}" "${locale}"
 [ !! ]
*  (2/2) Generating fr_FR.ISO-8859-15@euro.../usr/sbin/locale-gen: line 264:  2682 Segmentation fault      "${DESTDIR}"usr/bin/localedef ${LOCALEDEF_OPTS} -i "${input}" -f "${charmap}" -A "${ALIAS}" --prefix "${DESTDIR}" "${locale}"
 [ !! ]
* Generation complete



I've just reinstalled glibc. I still have this error when running locale-gen -u after the boot. And, I still have to run locale-gen on every boot.

I notice there were actually several locale-archive modified:
Code:
ls -l /usr/lib*/locale
lrwxrwxrwx 1 root root   17 2009-06-21 18:51 /usr/lib32/locale -> /usr/lib64/locale

/usr/lib64/locale:
total 1232
-rw-r--r-- 1 root root 1330784 2009-06-21 19:37 locale-archive

/usr/lib/locale:
total 1232
-rw-r--r-- 1 root root 1330784 2009-06-21 19:37 locale-archive


This is really annoying since wicd won't start if proper locale are not available (other than C or POSIX) :(

I keep you informed :)

EDIT: I found this bug https://bugs.gentoo.org/show_bug.cgi?id=214687 which may be related to my problem => installed gcc-4.4.0 and reinstalled glibc, but still the same, I just don't understand!
_________________
The End of the Internet!
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1129
Location: Romania

PostPosted: Mon Jun 22, 2009 5:41 am    Post subject: Reply with quote

Did you install glibc without "glibc-omitfp" flag?
Did you install glibc-2.10 with gcc-4.4.0?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Mon Jun 22, 2009 7:28 am    Post subject: Reply with quote

sebaro wrote:
Did you install glibc without "glibc-omitfp" flag?
Did you install glibc-2.10 with gcc-4.4.0?


Oh yes, sorry, glibc-omitftp is disabled for glibc, and I did reinstall this package after having installed gcc-4.4.0
Code:
* sys-libs/glibc :2.2 [R 2.10.1] <target>
    Reasons: sys-devel/gcc-4.4.0:4.4::installed
    -debug -gd -glibc-omitfp (-hardened) (multilib) nls -profile (-selinux) -vanilla build_options: -optional_tests


BUG REPORT: sys-libs/glibc-2.10.1: locale-archive replaced on every boot and...
_________________
The End of the Internet!
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Jun 24, 2009 8:04 pm    Post subject: Reply with quote

wow, the gcc upgrade wasn't actually a really good idea... I could not boot or event chroot into the system after this update, every binary was failing.

Well, since this install was a few days old (stage4 install), I decided I could try reinstalling from scratch... which I did, and... which wasn't apparently enough to fix my problem! I really don't get it.
_________________
The End of the Internet!
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Jun 25, 2009 3:33 pm    Post subject: Reply with quote

Since this was starting to *really* annoy me, I modified my initramfs to copy a backup of the locale-archive file juste before everything else:

Code:
   # durty hack
   if [ "x$FIXLOCALE" == 'xyes' ]; then
      busybox md5sum ${NEWROOT}/locar.bkp ${NEWROOT}/usr/lib*/locale/locale-archive >> ${NEWROOT}/test
      for i in 32 64; do
         cp -v ${NEWROOT}/locar.bkp ${NEWROOT}/usr/lib${i}/locale/locale-archive
      done
   fi 


And, I only needed this hack once. This looks like the file was lock by something, lsof /usr/lib*/locale/locale-archive reports mpd and wicd had these files open.

This means that if I just listened to you sebaro:
Quote:
You can try removing all init scripts from default runlevel and run them yourself. Maybe one of them is creating the issue.
I would have probably fixed my problem way earlier! (A script wasn't causing the issue, but the started daemons themselves were -- assuming the lock was really the problem of course..)


Thank you for your support:)


EDIT: The question is: how does the lock would really work?
_________________
The End of the Internet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum