Subject: Re: /etc/rc.d scripts and $PATH
To: None <current-users@NetBSD.org>
From: Peter Seebach <seebs@plethora.net>
List: current-users
Date: 09/15/2003 10:49:27
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.

-s