[plug] Where to set an environment variable in CentOS?

Peter Sutter sutterp at sopac.com.au
Sun Oct 3 22:53:29 WST 2010

Fred Janon wrote:
> I installed Tomcat6 on a CentOS distrib and I need to set an environment variable as indicated here in a user's post:
> ------------------
> Add the $CATALINA_HOME environment variable to your PATH.
> # vi /etc/profile
> CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.19
> ------------------
> I checked the /etc/profile file and it doesn't seem to be the best place to add it.
> What would be the best directory/file to actually set the variable so it is set globally when the system boots?
> Thanks
> Fred
> ------------------------------------------------------------------------
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
When bash is invoked as an interactive login shell, or as a 
non-interactive shell with the --login option, it first reads and 
executes commands from the file /etc/profile, if that file exists. After 
reading that file, it looks for ~/.bash_profile, ~/.bash_login, and 
~/.profile, in that order, and reads and executes commands from the 
first one that exists and is readable.

When an interactive shell that is not a login shell is started, bash 
reads and executes commands from ~/.bashrc, if that file 
<http://www.linuxquestions.org/questions/#> exists.


More information about the plug mailing list