Bug#803468: systemd: /etc/locale.conf locale variables are not set into the user locale

Josh Triplett josh at joshtriplett.org
Sat Oct 31 00:19:38 GMT 2015


On Sat, Oct 31, 2015 at 01:08:16AM +0100, Julian Andres Klode wrote:
> On Fri, Oct 30, 2015 at 08:32:19PM +0100, Michael Biebl wrote:
> > Am 30.10.2015 um 20:05 schrieb Josh Triplett:
> > > On Fri, 30 Oct 2015 19:09:16 +0100 Michael Biebl <email at michaelbiebl.de> wrote:
> > >> Am 30.10.2015 um 12:58 schrieb nfb:
> > >>> Package: systemd
> > >>> Version: 227-2
> > >>> Severity: normal
> > >>>
> > >>> Dear Maintainer,
> > >>>
> > >>> after installing locales package, generating my localization, editing
> > >>> /etc/locale.conf and finally rebooting the system, all the locales
> > >>> variable now default to "POSIX", as stated from the output of
> > >>> "locale".
> > >>> "localectl status", though, shows the desired values (the one i set in
> > >>> /etc/locale.conf), so the status printed by localectl is different
> > >>> from the actual status of the system.
> > >>> Here is the output of the two commands:
> > >>
> > >> There is no /etc/locale.conf in Debian, the correct file is
> > >> /etc/default/locale
> > > 
> > > What would it take for us to start making that transition?  Other
> > 
> > Someone how would the work to manage that transition.
> > A first step would probably be, to determine the list of packages which
> > touch /etc/default/locale in some way or another, starting from d-i.
> 
> AFAIK, the file is only automatically generated by update-locale
> from locales.

And sourced by pam_env.so in various services' /etc/pam.d files:

~$ grep -ir etc/default /etc/pam.d/*
/etc/pam.d/cron:session       required   pam_env.so envfile=/etc/default/locale
/etc/pam.d/gdm-autologin:session required        pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/gdm-launch-environment:session required        pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/gdm-password:session required        pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/login:# locale variables are also kept into /etc/default/locale in etch
/etc/pam.d/login:session       required   pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/polkit-1:session       required   pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0
/etc/pam.d/su:# locale variables are also kept into /etc/default/locale in etch
/etc/pam.d/su:session       required   pam_env.so readenv=1 envfile=/etc/default/locale

And a few other places (some of which probably shouldn't be):

cron.daily/apt:if [ -r /etc/default/locale ]; then
cron.daily/apt:    . /etc/default/locale
init.d/keyboard-setup:if [ -f /etc/default/locale ]; then
init.d/keyboard-setup:    . /etc/default/locale
init.d/cron:# there because it should be in /etc/default/locale.
init.d/cron:    for ENV_FILE in /etc/environment /etc/default/locale; do
init.d/cron:                 log_warning_msg "/etc/environment has been deprecated for locale information; use /etc/default/locale for $var=$value instead"
init.d/mountall.sh:if [ -r /etc/default/locale ]; then
init.d/mountall.sh:     . /etc/default/locale
init.d/gdm3:if [ -r /etc/default/locale ]; then
init.d/gdm3:  . /etc/default/locale
init.d/console-setup:if [ -f /etc/default/locale ]; then
init.d/console-setup:    . /etc/default/locale

> > Work out a plan to to switch (seamlessly) from the old to the new file,
> > file bugs and seeing it through to the end.
> 
> It's not difficult, just make one be a symlink to the other,
> as the format is the same (AFAICT).
> 
> For sanity reasons, /etc/default/locale should be moved to
> /etc/locale.conf, and /etc/default/locale should become a
> compat symlink.

Agreed.  That should take care of programs like the above, which can
then transition to either /etc/locale.conf or obtaining the settings in
some better way.  Preferably the latter, as "man locale.conf" also says:

> Note that the kernel command line options locale.LANG=,
> locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=,
> locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=,
> locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=,
> locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=,
> locale.LC_IDENTIFICATION= may be used to override the locale settings
> at boot.

We'll need to figure out which package will manage this transition,
preferably something other packages can add a versioned dependency on.

- Josh Triplett




More information about the Pkg-systemd-maintainers mailing list