On Fri, Feb 16, 2024 at 10:24:07AM +0200, Anssi Saari wrote:
> With the recent LC_ALL thread, I noticed I have LC_TIME set by
> mysterious means on at least two headless systems, for example:
> 
> $ locale
> LANG=en_US.UTF-8
> LANGUAGE=
> LC_CTYPE=en_US.utf8
> LC_NUMERIC=en_US.utf8
> LC_TIME=en_DK.utf8
> LC_COLLATE=en_US.utf8
> LC_MONETARY=en_US.utf8
> LC_MESSAGES=en_US.utf8
> LC_PAPER=en_US.utf8
> LC_NAME=en_US.utf8
> LC_ADDRESS=en_US.utf8
> LC_TELEPHONE=en_US.utf8
> LC_MEASUREMENT=en_US.utf8
> LC_IDENTIFICATION=en_US.utf8
> LC_ALL=

This is *extremely* abnormal locale output.  Here's mine:

unicorn:~$ locale
LANG=en_US.utf8
LANGUAGE=
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME=C
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Do you see what's different?  The double quotes are meaningful here.
A value that's printed in double quotes is not actually set -- it's
deduced from LANG.  In my output, the only values that are actually
set are LANG and LC_TIME.

In yours, *every* variable is set (except LANGUAGE and LC_ALL).

> LC_TIME ends up with en_DK.utf8. It's what I usually want so I've
> probably set this up and possibly I did it in the Debian installer but
> where does it come from? /etc/default/locale has just LANG=en_US.UTF-8
> 
> find /etc /home/as -type f -print0 -follow|xargs -0 grep -e LC_TIME -e en_DK
> 
> does find some matches, in /etc/locale.gen as expected and in some
> binary files but not in any relevant config file. Come to think of it,
> is this actually hidden inside the initrd somehow?

I can't imagine how the initrd would be related.

My first suspicion would be your desktop environment, if you're running
one.  Who knows what those things do.

If you login on a text console (Ctrl-Alt-F2 for example), do you still
get these same locale values?  How about "ssh localhost" (if an ssh
server is installed)?  If those differ from what you see in your desktop
environment, then it's a strong indicator the DE is doing something.

Reply via email to