Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 465468 - sys-apps/systemd: locale values aren't set by locale.conf
Summary: sys-apps/systemd: locale values aren't set by locale.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
: 478190 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-11 06:28 UTC by Pavel Volkov
Modified: 2013-12-02 20:59 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Migration code for sys-apps/systemd (systemd-migrate-locale.patch,2.07 KB, patch)
2013-09-16 01:31 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Volkov 2013-04-11 06:28:04 UTC
I'm trying to set system locale with localectl and can't succeed.

Reproducible: Always

Steps to Reproduce:
1. Remove /etc/env.d/02locale
2. run env-update
3. run "localectl set-locale LANG=ru_RU.utf8,LC_MESSAGES=en_US.utf8,LC_TIME=ja_JP.utf8"
/etc/locale.conf contains:
LANG=ru_RU.utf8,LC_MESSAGES=en_US.utf8,LC_TIME=ja_JP.utf8
(same setup was in 02locale)
4. Reboot

Actual Results:  
All LC_ variables and LANG are set to POSIX


$ localectl list-locales
en_US.utf8
ja_JP.utf8
ru_RU.utf8

Portage 2.2.0_alpha171 (default/linux/amd64/13.0/desktop/kde, gcc-4.7.2, glibc-2.17, 3.8.5-gentoomelf x86_64)
=================================================================
System uname: Linux-3.8.5-gentoomelf-x86_64-Intel-R-_Core-TM-_i5-2400_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:    16414312 total,  11354160 free
KiB Swap:    5242876 total,   5242876 free
Timestamp of tree: Wed, 10 Apr 2013 15:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.2-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.8 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo custom
Installed sets: @fonts, @kde, @vim
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE NVIDIA-r1 skype-4.0.0.7-copyright AdobeFlash-11.x MPEG-4 myspell-ru_RU-ALexanderLebedev grass-ipafonts BitstreamCyberbit freedist fairuse free-noncomm MSttfEULA vim.org as-is IUPAC-InChi CC-BY-NC-ND-3.0 NEWLIB LIBGLOSS"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/ibus/component/simple.xml /usr/share/polkit-1/actions"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -mtune=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ http://trumpetti.atm.tut.fi/gentoo/"
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://mirror.yandex.ru/gentoo-portage/"
USE="X a52 aac acl acpi alsa amd64 anthy bash-completion bluetooth branding bzip2 cairo cdda cdr cjk cli cracklib crypt cups cxx dbus declarative directfb djvu dri dts dvd dvdr efi emboss encode exif fam fbcon ffmpeg firefox flac fortran gdbm gif gpm gstreamer gtk iconv icu idn introspection ipv6 jpeg kde kipi lame lcms libcaca libnotify lm_sensors mad matroska mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf perl phonon plasma png policykit ppds python qt3support qt4 raw readline samba scanner sdl semantic-desktop session spell sse sse2 ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vdpau vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB ru ja" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Alexander Tsoy 2013-04-15 12:04:21 UTC
(In reply to comment #0)
> 3. run "localectl set-locale
> LANG=ru_RU.utf8,LC_MESSAGES=en_US.utf8,LC_TIME=ja_JP.utf8"
> /etc/locale.conf contains:
> LANG=ru_RU.utf8,LC_MESSAGES=en_US.utf8,LC_TIME=ja_JP.utf8
> (same setup was in 02locale)

With commas? o_O
Comment 2 Pavel Volkov 2013-04-15 15:15:59 UTC
Commas in localectl commandline and locale.conf, newlines in /etc/env.d/02locale.
Single assignment isn't working anyway.
Comment 3 Alexander Tsoy 2013-04-15 15:35:10 UTC
Using commas is not correct. You should execute this command:

$ sudo localectl set-locale "LANG=ru_RU.utf8" "LC_MESSAGES=en_US.utf8" "LC_TIME=ja_JP.utf8"
$ cat /etc/locale.conf 
LC_TIME=ja_JP.utf8
LANG=ru_RU.utf8
LC_MESSAGES=en_US.utf8
Comment 4 Mike Gilbert gentoo-dev 2013-07-13 22:50:37 UTC
This seems like PEBKAC. ;)
Comment 5 Pavel Volkov 2013-07-15 05:50:52 UTC
I already said that single assignments (only LANG=) don't work, too. This isn't a comma/newline problem.
Current state:

$ cat /etc/env.d/02locale
# Configuration file for eselect
# This file has been automatically generated.
#LANG=ru_RU.utf8
#LC_MESSAGES=en_US.utf8
#LC_TIME=ja_JP.utf8

$ cat /etc/locale.conf
LANG=ru_RU.utf8
LC_MESSAGES=en_US.utf8
LC_TIME=ja_JP.utf8

$ 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=
Comment 6 Ray Griffin (rorgoroth) 2013-07-15 14:36:30 UTC
Just to chime in (keep in mind I no longer have the Gentoo box to provide further details) I had this exact same issue when removing 02locale and everything reporting as POSIX.

I had locale set via systemd's file and command line as I have done in other distros and still no luck. I ended up exporting my desired locale at login. 

I actually had this in Arch Linux before they made the full switch and I had the exact same POSIX 'issue' until they moved their locale.sh in the filesystem package (I'm not sure on the specifics of where it was or doing at the time though).
Comment 7 Arnaud Vallette d'Osia 2013-07-28 06:38:47 UTC
I actually encounter the exact same bug : confirming it so,
plus I think 478190  is a duplicate of that one.

...and I encounter 474946 too, but it must not be related :
locales are variables : they would not fail to set for paths reasons.
Or would they ?
Comment 8 Arnaud Vallette d'Osia 2013-07-28 09:45:43 UTC
actually, just realized that I am not using 205 version of systemd,
but 201... And I'm about to upgrade to 204 for it just got keyworded.

Still, I have interesting complement to previous post :

root ~ # localectl list-locales
en_US
en_US.iso88591
en_US.utf8
fr_FR.iso885915@euro
fr_FR.utf8@euro
fr_FR@euro

root ~ # localectl 
   System Locale: LANG=fr_FR.utf8@euro
       VC Keymap: n/a
      X11 Layout: n/a

root ~ # systemctl status localed.service
localed.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)

there definetly exists a diference between gentoo's tree
and the one systemd expects (fedora's one ?)
Comment 9 Alexander Tsoy 2013-07-28 10:29:34 UTC
Last time I tried to remove /etc/env.d/02locale with systemd-201, I also encounter this bug.

(In reply to Arnaud Vallette d'Osia from comment #8)

> root ~ # systemctl status localed.service
> localed.service
>    Loaded: error (Reason: No such file or directory)
>    Active: inactive (dead)
> 
> there definetly exists a diference between gentoo's tree
> and the one systemd expects (fedora's one ?)

The unit name is systemd-localed.service.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-29 09:59:11 UTC
*** Bug 478190 has been marked as a duplicate of this bug. ***
Comment 11 redneb 2013-07-29 10:28:26 UTC
I am copying what I wrote in #478190:

I have the following in my /etc/locale.conf:
LANG="en_US.UTF-8"
LC_TIME="en_GB.UTF-8"

Here's description of the problem (this is with systemd 201 & 204):
* when I login using the linux console on tty1 or via ssh, none of the locale variables is set
* when I run bash in gnome-terminal, only LANG is set (to "en_US.UTF-8")
* when I run any graphical gnome application, only LANG is set for that application
If I symlink /etc/env.d/02locale to /etc/locale.conf then everything works correctly but I think the locale should be set in one place only.
Comment 12 redneb 2013-07-29 10:29:23 UTC
For comparison, in arch linux with systemd, the only place where locale variables are set is /etc/locale.conf and everything works correctly. They do it by having the following lines in /etc/profile.d/locale.sh (among other things):

if [ -r /etc/locale.conf ]; then
  . /etc/locale.conf
fi
Comment 13 Pavel Volkov 2013-08-20 09:58:35 UTC
I'll remove version number here.
Comment 14 Evgeny Bobkin 2013-08-22 07:40:27 UTC
This is a possible trap for all gnome 3.8 users, because gnome is known for not working well within non unicode locales!
Comment 15 Pacho Ramos gentoo-dev 2013-08-22 07:54:52 UTC
(I am in systemd team since some weeks ago)(In reply to Evgeny Bobkin from comment #14)


> This is a possible trap for all gnome 3.8 users, because gnome is known for
> not working well within non unicode locales!

-> wiki page was updated to point people to proper configuration steps until this is fixed, or do you think it should be improved (from a docs point of view)? :/
Comment 16 Evgeny Bobkin 2013-08-22 14:26:18 UTC
(In reply to Pacho Ramos from comment #15)
> (I am in systemd team since some weeks ago)(In reply to Evgeny Bobkin from
> comment #14)
> 
> 
> > This is a possible trap for all gnome 3.8 users, because gnome is known for
> > not working well within non unicode locales!
> 
> -> wiki page was updated to point people to proper configuration steps until
> this is fixed, or do you think it should be improved (from a docs point of
> view)? :/

regarding the wiki and gnome docs, so far so good:)

I meant, it looks like this bug report lost an attention of developers working on systemd integration.

only Mike Gilbert in comment 4 looked at it quickly and marked as PEBKAC ("Problem Exists Between Keyboard And Chair")

One of the possible solutions suggested in comment 12 is really trivial.

just to include a file /etc/profile.d/locale.sh with the following context:

if [ -r /etc/locale.conf ]; then
  . /etc/locale.conf
fi

Or is it more complicated?
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-22 15:43:45 UTC
        dir = opendir("/usr/lib/locale");
        if (!dir) {
                log_error("Failed to open locale directory: %m");
                return -errno;
        }

Now, we do install /usr/lib64/locale wrong or is it their fault? AFAICS I've got 'locale' in lib64 and lib32, with identical contents.
Comment 18 Pacho Ramos gentoo-dev 2013-08-22 15:54:03 UTC
(In reply to Evgeny Bobkin from comment #16)
[...]
> if [ -r /etc/locale.conf ]; then
>   . /etc/locale.conf
> fi
> 
> Or is it more complicated?

I doubt other devs will agree with changing where do we set locales to comply systemd :( Also, it would "hide" the problem of systemd not loading the file itself and we needing to use profile to load it :|
Comment 19 Pavel Volkov 2013-08-22 17:03:20 UTC
(In reply to Pacho Ramos from comment #18)
> I doubt other devs will agree with changing where do we set locales to
> comply systemd :( Also, it would "hide" the problem of systemd not loading
> the file itself and we needing to use profile to load it :|

Is it possible to create a symlink /etc/locale.conf -> /etc/env.d/02locale for both localectl and locale loading to work?
Comment 20 Samuli Suominen (RETIRED) gentoo-dev 2013-08-22 18:44:08 UTC
(In reply to Pavel Volkov from comment #19)
> Is it possible to create a symlink /etc/locale.conf -> /etc/env.d/02locale
> for both localectl and locale loading to work?

It can be any number, and any sequence of letters in /etc/env.d/, for example, I'm using /etc/env.d/01local to set my locales next to other custom settings.
I don't think using specific filename /etc/env.d/02locale has ever been mandatory in Gentoo, rather they get set the way env-update works.

Just wondering, what's the upgrade path... if it is changed to locale.conf also for non-systemd users
Comment 21 Pavel Volkov 2013-09-09 05:56:15 UTC
(In reply to Samuli Suominen from comment #20)
> It can be any number, and any sequence of letters in /etc/env.d/, for
> example, I'm using /etc/env.d/01local to set my locales next to other custom
> settings.
> I don't think using specific filename /etc/env.d/02locale has ever been
> mandatory in Gentoo, rather they get set the way env-update works.

The official way to set locale is 'eselect locale', but it does not support multiple variables, I think.
If we assume that eselect does know the correct file in env.d (I don't know if it's fixed ot not), it could also create the symlink if it does not exist yet.
People like you who use non-standard files can create it manually then.

I don't think this is the best approach though. It will break if 'localectl set-locale' is initially called before 'eselect locale'.
Comment 22 Mike Gilbert gentoo-dev 2013-09-15 20:36:41 UTC
We should not need to symlink anything here; the shell is supposed to inherit the setting from the systemd process which starts it.

I believe the real problem here are these lines in getty@.service:

# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=


This completely breaks the locale handling for console logins. We should try to get this fixed by systemd upstream.
Comment 23 Mike Gilbert gentoo-dev 2013-09-15 20:42:58 UTC
Adding link to related Fedora bug. Here is the relevent commit:

commit 1640944a847249d3f5f0fb0d5a5f820a82efaed0
Author: Lennart Poettering <lennart@poettering.net>
Date:   Thu Jan 6 20:38:06 2011 +0100

    getty: unset locale before execution
    
    On the console indian characters cannot be displayed, hence it is
    advisable to disable indian locales on the console, which most
    distributions traditionally did from a shell fragment executed post
    login. If getty gets started with locale settings passed it would itself
    however be translated without the no-indian-on-console fixup applied.
    
    Hence, for now don't pass any locale settings to getty/login, and thus
    rely on the classic post-login script fragment to set and fix the
    locale.
    
    Eventually we probably want to drop this again since the system locale
    should be read and set at one place, and not at multiple, and that one
    place should be PID 1.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=663900



So basically, they got lazy and didn't fix it properly. I suppose we will need to implement a similar workaround.
Comment 24 redneb 2013-09-15 20:47:40 UTC
(In reply to Mike Gilbert from comment #22)
> We should not need to symlink anything here; the shell is supposed to
> inherit the setting from the systemd process which starts it.

Unfortunately, it's not that simple. Locale variables are reset but many other programs as well. For example, /bin/login does it. So even if getty is started with the correct locale, it will be modified before the user logs in the linux console. I have discovered similar problems with other programs such as sshd and gdm.
Comment 25 Mike Gilbert gentoo-dev 2013-09-15 21:00:38 UTC
(In reply to redneb from comment #24)

I am unable to reproduce the behavior you describe with /bin/login; after I remove those lines from getty@.service and reload systemd, the LANG setting is passed all the way down to my shell as I would expect.

For sshd, we allow clients to set LANG and LC_* by default. See bug 367017.

Last time I checked, GDM allows you to select your locale from a drop-down, so that behavior is intentional.
Comment 26 Mike Gilbert gentoo-dev 2013-09-15 21:11:40 UTC
(In reply to Samuli Suominen from comment #20)
> (In reply to Pavel Volkov from comment #19)
> > Is it possible to create a symlink /etc/locale.conf -> /etc/env.d/02locale
> > for both localectl and locale loading to work?
> 
> It can be any number, and any sequence of letters in /etc/env.d/, for
> example, I'm using /etc/env.d/01local to set my locales next to other custom
> settings.
> I don't think using specific filename /etc/env.d/02locale has ever been
> mandatory in Gentoo, rather they get set the way env-update works.
> 
> Just wondering, what's the upgrade path... if it is changed to locale.conf
> also for non-systemd users

This symlink idea actually sounds like our best option at the moment. We could just have sys-apps/gentoo-systemd-integration create it in pkg_postinst if /etc/locale.conf does not exist.

For existing users, we can ewarn if locale.conf is not a symlink to /etc/env.d/02locale.

Any objections?
Comment 27 Mike Gilbert gentoo-dev 2013-09-15 21:14:54 UTC
(In reply to Mike Gilbert from comment #26)

Actually, that won't work because localed unlinks /etc/locale.conf.

We could do a symlink in the other direction though:

/etc/env.d/02locale -> /etc/locale.conf
Comment 28 redneb 2013-09-15 21:48:23 UTC
(In reply to Mike Gilbert from comment #25)
> (In reply to redneb from comment #24)
> 
> I am unable to reproduce the behavior you describe with /bin/login; after I
> remove those lines from getty@.service and reload systemd, the LANG setting
> is passed all the way down to my shell as I would expect.

Yes, the LANG variable is not reset by login. But try setting LC_TIME to something different. Same with gdm; some variables are preserved, some are not.
Comment 29 Mike Gilbert gentoo-dev 2013-09-15 21:57:05 UTC
(In reply to redneb from comment #28)

Ah, I see. Thanks for the clarification.
Comment 30 Mike Gilbert gentoo-dev 2013-09-16 01:31:41 UTC
Created attachment 358744 [details, diff]
Migration code for sys-apps/systemd

Possible problems:

1. 02locale may contain setting that localed will ignore (like LC_ALL).
2. The user may have locale settings in some file other than 02locale.

Personally, I think this is "good enough" and we can ignore these problems since they will not affect many users.
Comment 31 Alexander Tsoy 2013-09-16 10:06:11 UTC
(In reply to Mike Gilbert from comment #30)
> Created attachment 358744 [details, diff] [details, diff]
> Migration code for sys-apps/systemd

What's wrong with the approach used by Fedora and Arch? They install script in /etc/profile.d, that source /etc/locale.conf and export all necessary veriables.

Arch supply /etc/profile.d/locale.sh: see attachment in bug 478190
Fedora supply /etc/profile.d/lang.sh: see [1], this is the latest version according to [2].


[1] http://fedorahosted.org/releases/i/n/initscripts/initscripts-9.50.tar.bz2
[2] http://pkgs.fedoraproject.org/cgit/initscripts.git/tree/initscripts.spec
Comment 32 Alexander Tsoy 2013-09-16 10:18:50 UTC
(In reply to Alexander Tsoy from comment #31)
> Fedora supply /etc/profile.d/lang.sh: see [1], this is the latest version
> according to [2].

Direct link:
https://git.fedorahosted.org/cgit/initscripts.git/tree/lang.sh
Comment 33 Mike Gilbert gentoo-dev 2013-09-16 23:10:16 UTC
Yeah, profile.d would work too. Might be a bit cleaner.
Comment 34 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-17 07:30:52 UTC
Is there any specific difference between profile.d and env.d except for that env.d needs 'env-update' call?

As for other distros, I'd really dislike Fedora's overkill. Arch's better but still, I think we shouldn't be going this way unless there's a well-approved ~/.config/locale.conf.

The manpage says only about /etc/locale.conf. It also says:

  Depending on the operating system, other configuration files might be checked
  for locale configuration as well, however only as fallback.

I don't know about unsetting (is there anything to unset?). env.d avoid the explicit 'export' line.
Comment 35 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-18 11:11:42 UTC
Fixed in -207-r1.
Comment 36 SpanKY gentoo-dev 2013-12-02 20:59:14 UTC
(In reply to Michał Górny from comment #17)

you cannot hardcode a specific locale dir.  it is an ABI-specific generated file (encodes things like alignment and endianness).  i'm not sure why any file is even poking in that path when it only contains files meant for internal glibc use and uses a file format that is not guaranteed to be stable.