Subject: Re: /etc/rc.d scripts and $PATH
To: Peter Seebach <seebs@plethora.net>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 09/15/2003 12:01:29
In message <200309151549.h8FFnRiS010820@guild.plethora.net>, Peter Seebach writ
es:
>In message <Pine.NEB.4.53.0309150840300.716@rivendell.starwolf.com>, Greywolf 
>w
>rites:
>>Is there a reason you're running as super-user without those four
>>directories first in your $PATH?  [Maybe it's just me, but everything
>>else comes after those.]  Does your PATH not get set when you 'su'?
>>Are you running via 'sudo'?
>
>My path seems not to get changed by default when I su.  This is actually
>sometimes desirable - I do want my bin in $PATH *somewhere* - but it can
>cause surprising results.
>
>This problem only shows up when you have a utility whose name didn't always
>clash with a system binary, but does now...
>
>There's two desirable outcomes:
>1.  rc.d scripts always run with a canonical $PATH, so they always work.
>2.  rc.d scripts honor the existing $PATH, so they can be used to test new
>binaries.
>
>I think I favor 1 over 2.
>

I agree.  I can't speak for anyone else, but I regularly run assorted 
rc.d scripts manually as a part of system operation and maintenance.  
It would be nice if the results were more predictable.  My default path 
includes */sbin, but it includes other directories as well, which means 
that sometimes things will work if started manually but not at boot 
time.


		--Steve Bellovin, http://www.research.att.com/~smb