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

Re: setting up environment variables

Daniel B. wrote:
> Shouldn't global environment variables be set in /etc/environment?

For anything that comes in through PAM.  But if it does not come
through PAM then /etc/environment will have no effect.  PAM is used
for login shells and such.  But not for /etc/init.d daemon startup for

> If you set them in /etc/profile, they won't be set for all shells,
> will they?

The /etc/profile file is only used for Bourne-like shells such as sh,
bash, ash, ksh, dash, zsh, etc.  But for example if zsh is installed
and /etc/zprofile exists then /etc/profile is not read.  But in any
case /etc/profile is not used for csh, tcsh, and other wierd shells.

Basically there is no perfect way to set environment variables for all
shells.  But /etc/profile is pretty darn good and would probably cover
99.44% of the cases and all of the "normal" cases.


Attachment: signature.asc
Description: Digital signature

Reply to: