You are not logged in.
Pages: 1
Topic closed
For the past year, my locale has stopped working, it's just POSIX, no matter what I do. I can't figure out why, and I've now decided to really get to the bottom with this.
Available locales:
[~]% locale -a
C
POSIX
en_US.utf8
de_DE.utf8
The locale set:
[~]% locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Also, I don't have any ~/.config/locale.conf, $XDG_CONFIG_HOME/locale.conf, nor $HOME/.config/locale.conf, that would shadow the /etc/locale.conf.
[~]% more /etc/locale.conf
LANG=de_DE.UTF-8
The locales available when I run locale-gen
[~]% grep -v "#" /etc/locale.gen
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
Output when I generate locales explicitly:
[~]% sudo locale-gen
Generating locales...
en_US.UTF-8... done
de_DE.UTF-8... done
Generation complete.
Also, this returns nothing, so no variable is set in the terminal
[~]% env | grep LANG*
[~]%
Also, if it helps:
[~]% grep -d skip LANG "$HOME"/.*
~/.zcompdump:'-value-,LANG,-default-' '_locales'
~/.zcompdump:'-value-,LANGUAGE,-default-' '_locales'
This is getting increasingly frustrating, and help much appreciated.
Last edited by penguin (2016-06-26 11:51:33)
Offline
What shell are you using? I'm guessing zsh?
Can you post the output of:
pacman -Qkk filesystem zsh
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Yes, I sue zsh.
[~]% pacman -Qkk filesystem zsh
backup file: filesystem: /etc/crypttab (Modification time mismatch)
backup file: filesystem: /etc/crypttab (Size mismatch)
backup file: filesystem: /etc/fstab (Modification time mismatch)
backup file: filesystem: /etc/fstab (Size mismatch)
backup file: filesystem: /etc/group (Modification time mismatch)
backup file: filesystem: /etc/group (Size mismatch)
warning: filesystem: /etc/gshadow (Permissions mismatch)
backup file: filesystem: /etc/gshadow (Modification time mismatch)
backup file: filesystem: /etc/gshadow (Size mismatch)
backup file: filesystem: /etc/hosts (Modification time mismatch)
backup file: filesystem: /etc/hosts (Size mismatch)
warning: filesystem: /etc/mtab (Symlink path mismatch)
warning: filesystem: /etc/mtab (Modification time mismatch)
backup file: filesystem: /etc/passwd (Modification time mismatch)
backup file: filesystem: /etc/passwd (Size mismatch)
warning: filesystem: /etc/resolv.conf (File type mismatch)
warning: filesystem: /etc/shadow (Permissions mismatch)
backup file: filesystem: /etc/shadow (Modification time mismatch)
backup file: filesystem: /etc/shadow (Size mismatch)
backup file: filesystem: /etc/shells (Modification time mismatch)
backup file: filesystem: /etc/shells (Size mismatch)
filesystem: 90 total files, 4 altered files
zsh: 1038 total files, 0 altered files
Also, my "/home" partition is encrypted, but not my "/".
Offline
If you create a new user, does it have the problem as well?
Offline
What shell are you using? I'm guessing zsh?
Oh-My-Zsh?
Offline
If you create a new user, does it have the problem as well?
I have now created both a zsh-user and a bash-user:
[~]# useradd -m -s /bin/bash guest_bash
[~]# useradd -m -s /bin/zsh guest_zsh
and when I log in as them, neither had working umlauts, and both have locale POSIX. Same with root-user.
Oh-My-Zsh?
Nope, regular zsh, but I think I might have stolen some config from there though. But that shouldn't matter, I guess, since my guest_zsh user above had minimal/no .zsh-file, and still not the right locale. Hmmm, unless new users get POSIX locale by default?
Offline
Anything in /etc/profile.d/ reference LANG?
Offline
Anything in /etc/profile.d/ reference LANG?
I have:
[~]% ls -1 /etc/profile.d/
gpm.sh
jre.csh.pacorig
jre.sh.pacorig
lesspipe.sh
locale.sh
mozilla-common.csh
mozilla-common.sh
perlbin.csh
perlbin.sh
Only instance of "lang" is in /etc/profile.d/locale.sh, which I assume is vanilla arch:
[~] more /etc/profile.d/locale.sh
#!/bin/sh
if [ -z "$LANG" ]; then
if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
. "$XDG_CONFIG_HOME/locale.conf"
elif [ -n "$HOME" ] && [ -r "$HOME/.config/locale.conf" ]; then
. "$HOME/.config/locale.conf"
elif [ -r /etc/locale.conf ]; then
. /etc/locale.conf
fi
fi
LANG=${LANG:-C}
export LANG
[ -n "$LC_CTYPE" ] && export LC_CTYPE
[ -n "$LC_NUMERIC" ] && export LC_NUMERIC
[ -n "$LC_TIME" ] && export LC_TIME
[ -n "$LC_COLLATE" ] && export LC_COLLATE
[ -n "$LC_MONETARY" ] && export LC_MONETARY
[ -n "$LC_MESSAGES" ] && export LC_MESSAGES
[ -n "$LC_PAPER" ] && export LC_PAPER
[ -n "$LC_NAME" ] && export LC_NAME
[ -n "$LC_ADDRESS" ] && export LC_ADDRESS
[ -n "$LC_TELEPHONE" ] && export LC_TELEPHONE
[ -n "$LC_MEASUREMENT" ] && export LC_MEASUREMENT
[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION
Offline
Does this happen only when you log into X, or does it happen at a tty as well?
Offline
It's the same in tty as well, i.e. locale is POSIX.
Offline
I'm out of ideas, then.
Offline
/etc/profile.d/locale.sh is obviously only sourced by a login bash session (so no zsh).
whether it'll be sourced by an X session, i.e. by the scripts run by the login-manager that's questionable.
I use ~/.xprofile for setting my X-related environment variables, and since I never login from a tty that's all I need
Offline
/etc/profile.d/locale.sh is obviously only sourced by a login bash session (so no zsh).
This is incorrect. It's sourced by /etc/profile, which is sourced by /etc/zsh/zprofile.
Offline
What is the output of
localedef --list-archive
Offline
@Gosi
[~]% localedef --list-archive
en_US.utf8
de_DE.utf8
Offline
Doesn't look wrong.
Nevertheless you could try more charsets like this:
en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE@euro ISO-8859-15
If this does not work I would debug the problem like this:
Start zsh or bash with strace and exit right after start.
strace -o z.log zsh
exit
grep open z.log
to see which shell files are loaded during startup.
Put echo "LANG=$LANG" into these files or even move them temporarily to find the point where LANG / LC_* is set to POSIX.
Before that try running bash with --norc --noprofile to see if this has some impact.
Offline
You're getting POSIX because LANG is unset.
So something is either unsettling LANG, or /etc/profile is not being sourced.
You can check /etc/environment and /etc/security/pam_env.conf to see if they are unsetting LANG.
Offline
Did you disable global rc somewhere ?
What's in your ~/.zshenv ?
Offline
@Gosi
That's a good idea, to debug it, but doesn't that assume the problem is specific to zsh? Can I check $LANG value just before zsh starts loading?
I've put "echo '<name of file>: $LANG'" in "~/.zshenv" and "~/.zshrc", and the variable is empty in both cases.
Same goes for running "bash --norc --noprofile" followed by echo $LANG. It returns an empty variable / locale is POSIX.
Running strace, I get a long list of *.so files being opened, which I can't debug, I guess, but since I know things have gone bad when "~/.zshenv" is being accessed, the files opened prior to that are (with line numbers):
4:open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
8:open("/usr/lib/libcap.so.2", O_RDONLY|O_CLOEXEC) = 3
16:open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
23:open("/usr/lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
30:open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
38:open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
70:open("/dev/pts/4", O_RDWR|O_NOCTTY) = 3
99:open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 11
104:open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 11
108:open("/usr/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 11
118:open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 11
126:open("/proc/self/loginuid", O_RDONLY) = -1 ENOENT (No such file or directory)
132:open("/var/run/utmp", O_RDONLY|O_CLOEXEC) = 11
149:open("/usr/share/terminfo/r/rxvt-unicode-256color", O_RDONLY) = 11
261:open("/etc/zsh/zshenv", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
262:open("/usr/lib/zsh/5.2/zsh/newuser.so", O_RDONLY|O_CLOEXEC) = 3
274:open("/home/me/.zshenv", O_RDONLY|O_NOCTTY) = 3
800:open("/home/me/.zshrc", O_RDONLY|O_NOCTTY) = 3
@ukhippo Neither of the following commands finds anything (actually both files are commented out completely):
grep LANG /etc/security/pam_env.conf
grep LANG /etc/environment
@Nuocman
[~]% cat .zshenv
# -*- shell-script -*-
#because zsh in SuSE expands non-unique names!
setopt no_global_rcs
if [ -f /etc/SuSE-release ]; then
export PATH=/nfs/bin:$PATH
fi
export PATH=$HOME/usr/bin:$HOME/usr/local/bin:$PATH
export COWPATH=$HOME/usr/src/cow:/usr/share/cowsay/cows:$COWPATH
# #Don't include "/" as a word character. Makes C-w better on paths.
export WORDCHARS="*?_-.[]~=&;export%^(){}<>"
I'd like to emphasize that when I created a user with default bash login, the language was still POSIX, so then it's not something specific to zsh, or at least that's my take on it.
This sure is strange, and I feel like I'm going nuts here. If anyone has any other suggestions I'm all ears.
Thanks for all the suggestions!
Offline
#because zsh in SuSE expands non-unique names!
setopt no_global_rcs
Are you running Arch or SuSE? I'm pretty sure this declaration is the source of your problem (in zsh at least). Because of it, your /etc/zsh/zprofile isn't parsed, which kicks off the setting of /etc/profile env variables (including /etc/profile.d/locale.sh).
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
____(```\ .-'""""`-. /```)____
(____ \_____ / (O O) \ _____/ ____)
(____ ( ) ) ____)
(____ _______\ \____/ /_______ ____)
(______/ `-.____.-' \______)
Thanks! That did the trick! Man, reading the documentation, I have no idea what made me put that there (or when I did it).
I'm running arch, but have for many years used the same configuration files on the machine I have at work, which sadly is SuSE.
Thanks to all the rest of you as well for helping!
Offline
Great! If you're still having the same problem with bash, check your dotfiles for anything similar. Please let us know if you find the culprit.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
I'm having the same issue. All of the locales of a new user are set to "POSIX". I cannot figure out a way to change them.
Offline
1. don't necrobumpt, the thread is 8 years old
2. hardly
I'm running arch, but have for many years used the same configuration files on the machine I have at work, which sadly is SuSE.
Open a new thread and there post the output of
localectl; locale; locale -a
Offline
https://wiki.archlinux.org/title/Genera … bumping%22
Mod note: closing this old, solved topic.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed