Different PATHs in /etc/rc and /etc/rc.shutdown

From: Peter <pmc_at_citylink.dinoex.sub.org>
Date: Mon, 21 Mar 2022 13:27:49 UTC
Quoting Andre Albsmeier:

> Today I was bitten by the fact that /etc/rc.shutdown and /etc/rc set different
> PATHs at least on 12.3-STABLE (I used a command sitting in /usr/local/sbin w/o
> specifying its path and it worked in stop_cmd() but not in start_cmd()):
>
> /etc/rc.shutdown: PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
> /etc/rc:          PATH=/sbin:/bin:/usr/sbin:/usr/bin
> 
> Is there a reason for this? Or should they be made equal? In the latter case
> I will file a PR...

These paths are explicitely set in the /etc/rc and /etc/rc.shutdown;
i.e. the reason(s) should be in the commitlog.

Does it make sense? In my eyes, no. Having added /usr/local/sbin but
not /usr/local/bin does already look painsome to me.

Checking the commitlog: The /usr/local/sbin comes from the original
version of these files, but was removed from /etc/rc in 2002 per
        903163ac3e17
Here is your reason. Might that one just have forgotten to remove it
from rc.shutdown also? 
But then, just removing it now might surprizingly break some things 
people may have come up with in their takedown stuff. And, while
ports were somehow optional back then, they are pretty standard by
now, so I might alternatively suggest to add /usr/local/bin and
/usr/local/sbin to both of the scripts.

cheerio,
PMc