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

Environment Script System



I was curious if anybody has brought up the question of an environmental
script system in Debian yet? Such a system would make adding
environmental variables to a user's login sequence with a Debian package
much easier. A few other distros do this same thing. I am not trying to
copy features from distros, but presenting the idea on it's own merits.

Such a system would or could consist of a directory /etc/env.d or
otherwise named that would contain scripts to be executed in order by a
user's default login profile. The update-alternatives system could be
used to substitute scripts for specific packages.

A perfect example of the usability of this idea can be seen with setting
up a Java environment on Debian. Debian Java policy already contains a
number of ways for using alternatives to set the different available
executables from different competiting JVMs, and this would allow
alternatives to be used to manage the required Java environmental
variables.

An alternative "java-environment" could be set to point to a script for
each available JVM, which could set various environmental variables to
configure the JVM, such as JAVA_HOME. /etc/env.d/java could point to
/etc/alternatives/java-environment. Upon login, the correct Java
environment would be set up. Using the master/slave idea with
alternatives, a user could change their entire JVM setup by updating a
single alternative.

Obviously this idea has a lot of potential uses for more modularized
login scripts.

If a large number of scripts could potentially cause logins to be slowed
down, a command update-environment could be used to concatinate all the
scripts in /etc/env.d into a single file. This would only work if the
scripts were shell scripts however. I don't like this idea, it is only a
thought.

I'd like to know if anybody else has any opinions on this? Such a system
would be extremely easy to implement. It could be done simply by editing
/etc/environment to loop through each file, and including
/etc/environment by default in bash_profile or other shell login
scripts. A max of 5 lines.

Thanks for your time and consideration.

Jerry Haltom



Reply to: