[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need clarification about /etc/environment



Marc Haber <mh+debian-devel@zugschlus.de> wrote:
> I need some explanation about /etc/environment. Here is what I have
> found out:
[...]
> - Is evaluated for example by pam_env, causing "NAME=\VALUE" to be
>  parsed into the environment variable NAME with a value starting with
>  an actual backslash
[...]

Hello,
Afaics today it is exclusively evaluated by pam_env on Debian-systems;
take look at #17309 for an historical account.

> - Virtually every shell script I have seen simply sources the file
>  instead of properly parsing it.
[...]

Is there one shipped with Debian? - I just zgrepped /{usr/,}{s,}bin
/etc /usr/share/doc and /usr/share/man in vain.

> What is the canonical way of handling /etc/environment?

Imho you can expect that every setting you make in /etc/environment is
available in every interactive login (console, xdm, ssh, ...), but
_not_ in system services started via init or /etc/rc*. At least this
is the current practice, none of the daemons running on my machine
have the variables from /etc/environment in their environment.

> I don't want to simply source the file in my init.d script to fix
> bug #158981, since I now know this is wrong.
[...]

I'd close it and tell the submitter to edit /etc/init.d/console-log or
make setting the locale available via /etc/defaults/console-log or
extentend /etc/console-log.conf to make it possible to tail a
Russian file on tty8 and and German on on tty9. Evaluating
/etc/environment seems wrong to me.

Non-ASCII characters in syslog files as e.g. fetchmail generates them
are no good idea anyway, because there is no information about the
used charset.
              cu andreas
-- 
Hey, da ist ein Ballonautomat auf der Toilette!
Unofficial _Debian-packages_ of latest _tin_
http://www.logic.univie.ac.at/~ametzler/debian/tin-snapshot/



Reply to: