Hide Forgot
Description of problem: User locale is not set properly after DE (XFCE) login and with `bash -l`. Version-Release number of selected component (if applicable): systemd 229 How reproducible: always Steps to Reproduce: $ localectl set-locale LANG=en_US.utf8 LC_CTYPE="C.utf8" LC_NUMERIC="C.utf8" LC_TIME="C.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="C.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="bg_BG.utf8" LC_NAME="C.utf8" LC_ADDRESS="C.utf8" LC_TELEPHONE="C.utf8" LC_MEASUREMENT="C.utf8" LC_IDENTIFICATION="C.utf8" # reboot $ locale @@@ LANG=C.utf8 LC_CTYPE=C.utf8 LC_NUMERIC=C.utf8 LC_TIME=C.utf8 LC_COLLATE="C.utf8" LC_MONETARY=C.utf8 LC_MESSAGES="C.utf8" LC_PAPER=bg_BG.utf8 LC_NAME=C.utf8 LC_ADDRESS=C.utf8 LC_TELEPHONE=C.utf8 LC_MEASUREMENT=C.utf8 LC_IDENTIFICATION=C.utf8 LC_ALL= $ sudo su - myuser $ locale @@@ LANG=en_US.utf8 LC_CTYPE=C.utf8 LC_NUMERIC=C.utf8 LC_TIME=C.utf8 LC_COLLATE="en_US.utf8" LC_MONETARY=C.utf8 LC_MESSAGES="en_US.utf8" LC_PAPER=bg_BG.utf8 LC_NAME=C.utf8 LC_ADDRESS=C.utf8 LC_TELEPHONE=C.utf8 LC_MEASUREMENT=C.utf8 LC_IDENTIFICATION=C.utf8 LC_ALL= Basically doing `bash -l` doesn't help. Doing `sudo su - user` does help and LANG is properly set. But no other attempts help to have properly set LANG variable as configured by `localectl`.
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
localectl causes /etc/locale.conf to be updated with the new settings, and systemd will use this to set the environment of lightdm (or other login manager). But after you log in, those settings can be influenced by various other things, including at least the display manager and /etc/profile.d/lang.sh, which reads ~/.i18n. Since the settings for root match what you configured with localectl, it seems some other component resets the locale. Please do the following: - run "pstree -aps $$" to see a list of ancestors of your shell - look at each process's environment with "cat /proc/PID/environ | tr '\0' '\n'" where PID is each process number. You'll need so prefix this with 'sudo' for system processes. - you should see LANG=en_US.utf8 switch to LANG=C.utf8 at some point... This should be the place where the issue is.
Sorry, this fell under my rather. This is Fedora 27 now. I'm not sure pstree is very helpful. When terminal is started, it falls to parent "1". > $ pstree -aps $$ > systemd,1 --switched-root --system --deserialize 24 > └─xfce4-terminal,2543 > └─bash,6687 > └─pstree,31427 -aps 6687 > > $ cat /proc/2543/environ | tr '\0' '\n' | grep LANG > LANG=C.utf8 > $ sudo cat /proc/1/environ | tr '\0' '\n' | grep LANG > LANG=en_US.utf8 Still `bash -l` doens't help: > $ bash -l > $ echo $LANG > C.utf8 `sudo su -` still helps though > $ sudo su - user > [sudo] password for user: > $ echo $LANG > en_US.utf8 I don't think I have any customization wrt LANG, my first attempt at setting it was with `localectl`: > $ grep LANG ~/.* > grep: /home/user/.: Is a directory > grep: /home/user/..: Is a directory > ... I don't know how is systemd supposed to set LANG but it doesn't work for all sessions.
Now with Fedora 30 I do see LANG properly set under XFCE. I don't know what changed. > 🐚 localectl status > System Locale: LANG=en_US.utf8 > LC_CTYPE=C.utf8 > LC_NUMERIC=C.utf8 > LC_TIME=C.utf8 > LC_MONETARY=C.utf8 > LC_PAPER=bg_BG.utf8 > LC_NAME=C.utf8 > LC_ADDRESS=C.utf8 > LC_TELEPHONE=C.utf8 > LC_MEASUREMENT=C.utf8 > LC_IDENTIFICATION=C.utf8 Then > 🐚 set |grep LANG > LANG=en_US.utf8
OK, let's close then.