Environment variables for Debian (e.g. JAVA_HOME, etc)
I recently switched back from Debian to gentoo, after realizing that my
good old debian unstable was actually way less pain to maintain than my
super-bleeding-edge gentoo ;-)
However, I noticed some well-done framework on gentoo for which I
couldn't find a debian-equivalent : the env-update (/etc/env.d/*)
In fact, some packages usually need to place some environment variables
that should be set for all users. For example, the JAVA_HOME env. comes
to my mind, or the fact that the administrator may want every user to
automatically have $JAVA_HOME/bin in their $PATH.
(some applications are broken if JAVA_HOME is not set)
It looks like that under debian, the only way to go is by editing /etc/
profile, and manually adding export JAVA_HOME=whatever etc..
Under Gentoo, however, the jdk package installs a file under /etc/env.d/
which contains :
VERSION="Blackdown JDK 1.4.2_rc1"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC ADDPATH ADDLDPATH MANPATH"
then, you can run env-update which updates /etc/profile.env which is
sourced by /etc/profile, so that every user has correct environment
OK, I guess you could argue that it doesn't work for all shells, etc,
but the framework could be made to work for bash first, then env-update
could also update
So, has anyone already thought about this kind of stuff and decided that
it wasn't the right way to go ? if the answer is yes, what are the
reasons not to do such a beautiful thing ?
Thanks for your replies,
PS: please CC: me the answers since I'm not subscribed to debian-devel