tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

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




> On Aug 19, 2026, at 4:07 AM, Greg Troxel <gdt%lexort.com@localhost> 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



Home | Main Index | Thread Index | Old Index