You are not logged in.

#1 2017-08-04 07:00:41

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

locale gone after reboot

I've some strange issue with an Arch box here. My locale of choice seems to be gone after a reboot.

Outputs after reboot:

$ 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
$ 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=de_AT.UTF-8
LC_CTYPE="de_AT.UTF-8"
LC_NUMERIC="de_AT.UTF-8"
LC_TIME="de_AT.UTF-8"
LC_COLLATE="de_AT.UTF-8"
LC_MONETARY="de_AT.UTF-8"
LC_MESSAGES="de_AT.UTF-8"
LC_PAPER="de_AT.UTF-8"
LC_NAME="de_AT.UTF-8"
LC_ADDRESS="de_AT.UTF-8"
LC_TELEPHONE="de_AT.UTF-8"
LC_MEASUREMENT="de_AT.UTF-8"
LC_IDENTIFICATION="de_AT.UTF-8"
LC_ALL=
$ grep '^[^#]' /etc/locale.gen 
de_AT.UTF-8 UTF-8 
$ cat /etc/locale.conf
LANG=de_AT.UTF-8

Several programs complain about a missing locale:

$ tmux
tmux: invalid LC_ALL, LC_CTYPE or LANG
$ perl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "de_AT.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")

Generating the locale works as expected:

$ sudo locale-gen -a
Generating locales...
  de_AT.UTF-8... done
Generation complete.
$ locale -a
C
de_AT.utf8
POSIX

And now the programs mentioned before work as expected.

The problem is: this issue appears after each reboot. I can also observe that the sha1sum is different after a reboot.
Working:

$ sha1sum /usr/lib/locale/locale-archive
242d89ef53beba29947523bb0a262c7288084c4e  /usr/lib/locale/locale-archive

Not working:

$ sha1sum /usr/lib/locale/locale-archive
ae1a21bf5159968bd22f0a9b0384aa15e4e8e548  /usr/lib/locale/locale-archive

Do I miss something obvious here?

Offline

#2 2017-08-04 07:04:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: locale gone after reboot


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-08-04 13:19:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: locale gone after reboot

This has nothing to do with that bug report.

Sounds like the file simply isn't getting written to disk. What is the output of `mount`? Any errors on shutdown?

Offline

#4 2017-08-04 14:12:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,525

Re: locale gone after reboot

... check the timestamps of the file (to see whether it's updated or restored) and in doubt, "chattr +i" it until you figured the cause.

Online

#5 2017-08-04 14:15:58

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

Re: locale gone after reboot

There are no errors on shutdown.  Systemd unmounts all drives without errors.

Mount output:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=3921028k,nr_inodes=980257,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/mapper/root on / type ext4 (rw,relatime,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=26,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
/dev/sde1 on /boot type ext4 (rw,relatime,data=ordered)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=792160k,mode=700,uid=1000,gid=100)

Offline

#6 2017-08-04 14:22:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: locale gone after reboot

I don't see anything there that would cause problems. The timestamp would be interesting, know if it's reverting or getting overwritten.

Offline

#7 2017-08-04 14:23:34

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

Re: locale gone after reboot

seth wrote:

... check the timestamps of the file (to see whether it's updated or restored) and in doubt, "chattr +i" it until you figured the cause.

The timestamp of the file corresponds with the journal log entry where I ran locale-gen -a but the hashes don't match after reboot:

sudo journalctl -b -1 | grep "locale-gen -a"
Aug 04 08:59:56 nas sudo[626]:      flo : TTY=pts/0 ; PWD=/home/flo ; USER=root ; COMMAND=/usr/bin/locale-gen -a
$ ls -al /usr/lib/locale/locale-archive
-rw-r--r-- 1 root root 1669552 Aug  4 08:59 /usr/lib/locale/locale-archive

Offline

#8 2017-08-04 14:25:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: locale gone after reboot

And the timestamp's the same after the reboot?

BTW, the "-a" on locale-gen does nothing.

Offline

#9 2017-08-04 14:27:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,525

Re: locale gone after reboot

and all stamps, try "stat"

Online

#10 2017-08-04 14:34:04

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

Re: locale gone after reboot

Scimmia wrote:

And the timestamp's the same after the reboot?

Yes, I just ran locale-gen again and waited for another minute to pass. Afterwards I issued a reboot. The timestamp is still the same.

Scimmia wrote:

BTW, the "-a" on locale-gen does nothing.

Thx for the hint smile

Offline

#11 2017-08-04 14:39:33

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

Re: locale gone after reboot

seth wrote:

and all stamps, try "stat"

After locale-gen (works):

$ stat /usr/lib/locale/locale-archive
  File: /usr/lib/locale/locale-archive
  Size: 1669552   	Blocks: 3104       IO Block: 4096   regular file
Device: fe00h/65024d	Inode: 786640      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-08-04 16:34:49.226989466 +0200
Modify: 2017-08-04 16:34:47.250482497 +0200
Change: 2017-08-04 16:34:47.250482497 +0200
 Birth: -

After reboot (does not work):

$ stat /usr/lib/locale/locale-archive
  File: /usr/lib/locale/locale-archive
  Size: 1669552   	Blocks: 3112       IO Block: 4096   regular file
Device: fe00h/65024d	Inode: 786640      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-08-04 16:34:49.226989466 +0200
Modify: 2017-08-04 16:34:47.250482497 +0200
Change: 2017-08-04 16:34:47.250482497 +0200
 Birth: -

At first sight "Blocks" are different.

Offline

#12 2017-08-04 14:48:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,525

Re: locale gone after reboot

notgood.

HDD or SSD?

lsattr /usr/lib/locale/locale-archive

You could also try to remove the file to get it recreated (on another inode)
And better run smartctl ...

Online

#13 2017-08-04 14:56:20

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

Re: locale gone after reboot

seth wrote:

notgood.

HDD or SSD?

lsattr /usr/lib/locale/locale-archive

You could also try to remove the file to get it recreated (on another inode)
And better run smartctl ...

usb thumb drive

$ lsattr /usr/lib/locale/locale-archive
--------------e---- /usr/lib/locale/locale-archive

Deleted the file, ran locale-gen and rebooted. Same problem.

$ stat /usr/lib/locale/locale-archive
  File: /usr/lib/locale/locale-archive
  Size: 1669552   	Blocks: 3112       IO Block: 4096   regular file
Device: fe00h/65024d	Inode: 786718      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-08-04 16:52:19.965614771 +0200
Modify: 2017-08-04 16:52:05.859596059 +0200
Change: 2017-08-04 16:52:05.859596059 +0200
 Birth: -

Offline

#14 2017-08-04 15:01:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,525

Re: locale gone after reboot

usb thumb drive

ewww. errrr... dd it onto another drive? this is not the install medium, no overlays etc.?

in doubt explicitly run "sudo sync" before the reboot.

Online

#15 2017-08-04 16:10:38

nblock
Member
From: Austria
Registered: 2008-08-06
Posts: 123
Website

Re: locale gone after reboot

seth wrote:

ewww. errrr... dd it onto another drive? this is not the install medium, no overlays etc.?

No, not the install medium, no overlays …

seth wrote:

in doubt explicitly run "sudo sync" before the reboot.

Did that, no change. No errors in dmesg et al

Offline

#16 2017-08-04 19:27:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,525

Re: locale gone after reboot

Ok, so the old file was gone, you got a new inode, but the locales "reset" (you never had a "old" file there) and the timestamps of the file didn't change?

Sanity check: you can write and overwrite and keep other files across reboots?
Like "echo foo > /foo; echo bar > /foo" and after a reboot there's /foo and it contains "bar"?

Is the partition maybe (prettyprettyplease) encrypted?

Online

Board footer

Powered by FluxBB