Re: Changes to /etc/profile
Clint Adams wrote:
> > I've been asked to define PATH in /etc/profile only when it's not
> > already defined:
> > -PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
> > +[ "$PATH" ] || PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
> > so that users may rely exclusively on /etc/login.defs to change the PATH
> > system-wide. I will probably do that, but if you know of any undesired
> > side effects this may have, please speak now.
> This fails to set a sane PATH if the /etc/profile-reading shell imports
> a PATH of, say, "/bin:/usr/bin" (from /bin/login), or
> "/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin" from sshd, or whatever
> else likes to set its own special PATH.
> Of course, it's not really /etc/profile's responsibility to compensate
> for lack of consistency.
Hmm, yes, this is the sort of undesired effect I was talking about.
IMHO, a console login and a ssh login should both yield the same PATH.
So, I'm going to leave the PATH line unchanged for now, sorry!
About location of /usr/local/bin inside the PATH:
Michael Stone wrote:
> That's purely a matter of site policy, and no default will satisfy
> everyone. (I prefer local first, myself.)
Jesus Climent wrote:
> It is a matter of local policy: here we have it only for local users,
> while remote and root get no local bits on their path.
The user will always (or almost always) be able to change the default,
but I think there are objective reasons why putting /usr/local/bin at
the beginning makes *much* more sense than putting it at the end
and therefore it's a better default for a PATH.
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com