Re: Improving the performance of system boot by eliding unused rc.d scripts and caching the result

Jason Thorpe <[email protected]>
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>

> On Aug 19, 2026, at 4:07 AM, Greg Troxel <[email protected]> wrote:
> 
>> I guess I can really distill it down to: “A script is considered to do no useful work only if it definitively tells us so.”  And it does so by self-reporting that its rcvar is set to NO.
> 
> That seems sound.

Ok, it was a little more invasive, but I’ve made this more robust in the face of random scripts that care not for rules.  Skip-ability is now defined as “affirmatively outputs YES on stdout in response to the skipstart directive”; this required additional handling for scripts that declare themselves to be “interactive”.

So now a non-response or an error or Towers of Hanoi or the output of “fortune zippy” or whatever else you can or cannot think of will result in including the script in the boot process.

I’ve also incorporated kre’s feedback about cache-staleness (some additional delay observed, but overall it’s still a big win) and the various Shell programming best-practices he noted.

    https://www.netbsd.org/~thorpej/rcorder-cache-diff-v3.txt

I’ll see about dragging out my NeXT or Shark this evening for a diskless boot check.

-- thorpej
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.