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

Bug#65611: general: setting `global' env. variables, esp. PATH



Package: general
Version: N/A

There should be one, central location for the initial environment
variables that are to be set in each login session, independently of
the method used for logging in or the shell used by the user (if any).


Consider a system administrator who would like to add a new directory
to the default PATH.  Where should be the modification performed?

There's a PATH setting in /etc/login.defs.  Change it there?  No,
bash's /etc/profile resets the PATH to "Debian's default".

Change /etc/profile?  Bad choice, since it is not used by other
shells, like zsh, or X sessions.

Add a PATH line to /etc/environment?  Bad luck, /etc/profile comes
after it, so bash wins again.  Same for /etc/security/pam_env.conf.

Let's give up the principle of `one setting -- one config file' and
change all of the above, plus the startup files of any other shells
that might be in use and the maintainer was smart enough to mess with
the PATH in default startup scripts?  Sounds bad, and not even works in
some cases.  Zsh only sets the PATH in it's startup script if the
inherited PATH is empty or equals to some dumb default.  But sshd uses
a different dumb default, therefore zsh's PATH (and neither the one in
/etc/login.defs) does not apply when logging in through ssh.


This situation sucks.


Debian should make a policy decision where to set global environment
variables (PAM's pam_env.so + /etc/environment would be a good
choice), and modify related packages (that deal with user login, like
login or sshd, and shells) to use this single mechanism for setting
the initial environment and not to mess with it themselves.



Reply to: