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

Re: Where is the PATH set?



On Wed, Jan 05, 2005 at 05:57:13PM -0600, David Dyer-Bennet wrote:
> On a standard install woody system, in particular.
> 
> Particularly, where does it get set on console login, and where does
> it get set for an ssh session?  And where does it get set for an
> xterm?  And where does it get set for an Emacs shell window?  I'd
> prefer these to be the same, but....
> 
> And then, where is it set for a root session?  And for a zup-initiated
> root session?
> 
> Is it in /etc/profile?  Is it in /etc/bash.bashrc?  (or equivalent for
> other shells)? 
> 
> Is it in /etc/login.defs?
> 
> Or might it be in /etc/pam.d/login, or /etc/pam.d/ssh?  Or maybe
> /etc/security/pam_env.conf? 
> 
> It *looks like* it's set in /etc/profile.  But *why* it's set there I
> haven't a clue.  That's later than the more sensible places, so will
> override them.  And it's shell-specific, and only gets executed on
> certain kinds of shell startups. 
> 
> Why *isn't* it set in /etc/login.defs?  Does that not work?  Same
> question for pam_env.conf.  And how do those two compete with each
> other, by the way?  
> 
> This rather looks like it's starting to open a can of worms -- how
> user processes are started up.  Is this documented anywhere in enough
> detail to be of any use?  I'm afraid of deciding to do things one way,
> only to discover that that's on its way out and Debian is moving
> towards doing things another way, and the stuff I chose to standardize
> on was vestigial.  

I looked at the POSIX standard to see what it says about PATH. Of
course it is mentioned, but it seems its existence on a compliant
system is not even required. It is required that, if it exists, it
obey certain rules which are given in some detail. I didn't see any
indication that there are rules as to how and when it is set. (But, I
didn't really look hard)

HTH
-- 
Paul E Condon           
pecondon@mesanetworks.net



Reply to: