Subject: Bug#3290: sysvinit path doesn't include /usr/local/{,s}bin

From: [email-masked] (Ian Jackson)
Date: Thu, 18 Jul 96 17:52 BST

I wrote:
> [Closing Bug#3290, Miquel van Smoorenburg wrote:]
> > The PATH set in /etc/init.d/boot is only used in that script; remember that
> > you cannot modify the parents environment. If you want to change the
> > behavour of this script by simply putting binaries in /usr/local/sbin that
> > override the default binaries that won't work. An example with a custom
> > mount was given; but how do use use /usr/local/sbin/mount when /usr isn't
> > mounted yet ;) You'll have to edit the script anyway.
> 
> But this *will* work if the system administrator sets their system up
> so that /usr/local is on the root fs, for example.
>
> [...]
> > The only solution seems to be to change the PATH hardcoded in the init binary
> > itself. This is ofcourse a bit hard to do. Therefor init has another solution;
> > you can let all programs executed by init go through a script called
> > /etc/initscript. See the manpage: initscript(8). This is turned off by default,
> > and for a good reason: it spawns an extra shell for everything executed
> > by init.

It seems to me that init should have an appropriate default PATH.
This is especially true if the default is hard to change or override.

I've recently been bitten by an /etc/rc?.d script not having the PATH
I expected.

The default PATH for non-superuser programs everywhere should be
 /usr/local/bin:/bin:/usr/bin
and for superuser (admin) programs
 /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
should it not ?

Should it not therefore be the case that
 (a) the default PATH set by init when it runs things out of inittab
 should be /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
and
 (b) the scripts that init runs (/etc/init.d/boot, /etc/rc, &c) should
 either not modify their PATH or set it to that value, or should
 possibly read it from some system config file ?

I shall reopen this bug report, to ensure that the issue is not
forgotten; I hope we won't have to have more discussion before a
consensus is reached, but if we do I hope the sysvinit maintainer will
bear with us and allow us to keep the bug on his books while we agree
what to do.

Ian.