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

Ryan Murray Ryan Murray <rmurray@debian.org>, 265101@bugs.debian.org
Wed, 11 Aug 2004 11:52:06 -0700


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

On Wed, Aug 11, 2004 at 03:10:34PM -0300, Joey Hess wrote:
> 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.

/etc/environment is a config file for the pam_env module, to set up the
_login_ environment for the user.  It is not a config file for what
environment variables should be set at system startup time.  It would be
nice if there _was_ a file that could be sourced by all init scripts to
give the same environment as if the system was booting, but /etc/environment
isn't it.

> I suggest modifying the init.d script as described, and changing the

I'm not going to use /etc/environment for this.

> 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).
>=20
> 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

/etc/environment is for setting up a user's environment at login, not the
right source of default language.  I wish there was infrastructure in place
so that init scripts could be run with the same environment settings as
system boot, including the ability to set some, such as LANG.  Right now,
restarting a daemon is affected by whatever environment variables you have =
set.
This affects things like the default config files looked for by php.

> 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

Yes, it _is_ a login program, and setting up the user's login environment w=
ith
/etc/environment is appropriate.  That doesn't make it appropriate to read =
the
config for the user's login environment for the daemon itself.

> 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.

Ideally, whatever is used would also provide a way to cleanse the environme=
nt
from whatever might be set when a random su'd user runs an init script, to
provide the same environment that init does when running the scripts.

At this point, just the locale setting will do, I guess...

--=20
Ryan Murray, Debian Developer (rmurray@cyberhqz.com, rmurray@debian.org)
The opinions expressed here are my own.

--D5HQcwfjqNcvOcn2
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFBGmrWN2Dbz/1mRasRAke8AJ0UtZ/F1IS3x/DwDMPl5OkWtY/j2gCfbvh/
Ls+xU1fX0jQ3Mf9XjCYAQkM=
=jb5L
-----END PGP SIGNATURE-----

--D5HQcwfjqNcvOcn2--