Bug#265101: LANG in /etc/environment does not take effect after reboot

Joey Hess Joey Hess <joeyh@debian.org>, 265101@bugs.debian.org
Wed, 11 Aug 2004 15:10:34 -0300


--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: gdm
Version: 2.4.4.7-3
Severity: normal
Tags: d-i

Several Debian installation reports, including #264986 and #265016
mention a strange gdm behavior, which I have confirmed. These users
installed in non-English, and when base-config starts gdm for the first
time on the newly installed system, it comes up localised to their
language. However, when they reboot, gdm always comes up in English
thereafter.

I've investigated, and newly installed systems have a /etc/default/gdm
like this:

# GDM Defaults, source in the init script that starts GDM.  LANG
# setting is taken from the locales package by default.
LANG=3D
export LANG

(Aside: this export of LANG violates the strict letter of Debian policy
for defaults files. They are intended to only set variables, not export
them or call other shell commands. If you need LANG exported, it should
be exported in the init script after sourcing the defualts file.)

So there are two problems. First, the resulting "LANG=3D" unsets any
previously set value of LANG. Second, neither gdm nor its init script
seem to source /etc/environment to get the proper LANG setting as
provided by the installer.

I still don't understand why gdm is localised when it's started from
base-config. While base-config has exported LANG before running the init
script, I'd think the defaults file would unset it again, but it seems
to not.

I was able to get gdm to always come up localised by:

1. Commenting out the LANG settings in /etc/default/gdm.
2. Adding some lines near the top of /etc/init.d/gdm to source
   /etc/environment, and export LANG.

I suggest modifying the init.d script as described, and changing the
package to not write LANG=3D to /etc/default/gdm if it cannot get a LANG
setting from locales/default_environment_locale (which you won't, on a
fresh Debian install).

BTW, I looked at bug #133578, and IMHO, you just picked the wrong fix
for that bug entirely. locales is not the right source of default
language; /etc/environment is. I'd really recommend removing the changes
introduced to fix #133578, and just source /etc/environment as I
described. Ryan Murray's argument in
<20040417041342.GY13742@cyberhqz.com> seems wrong; /etc/environment
can be trivially parsed by sourcing it in the gdm init script, and gdm
*is* a login program, so sourcing /etc/environment is appropriate. But
this is only my opinion and I don't really care how you fix this bug. If
you would rather have d-i/base-config write a language setting to some
other file entirely, we could even do that.

And BTW, if this bug is not fixed soon (within a week), I will probably
start working around it in base-config. There are two workarounds I can
think of, the easiest is using kdm as the default greeter for new Debian
installs. Especially since gnome-session is *still* not fixed in
testing, so users already get KDE even when logging into gdm.

--=20
see shy jo

--opJtzjQTFsWo+cga
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBGmEad8HHehbQuO8RApLAAJ4uvNZtYo8ap3+WQyipTUVxEgNlzgCeOZi4
LiLsgVkKsmMf/ou11bSYRbY=
=ki1S
-----END PGP SIGNATURE-----

--opJtzjQTFsWo+cga--