Bug 249192 - /etc/rc changes to support new rcorder -p option for parallel startup.
Summary: /etc/rc changes to support new rcorder -p option for parallel startup.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-rc (Nobody)
URL: https://reviews.freebsd.org/D25389
Keywords: patch
Depends on:
Blocks:
 
Reported: 2020-09-08 11:41 UTC by unitrunker
Modified: 2020-09-15 18:20 UTC (History)
2 users (show)

See Also:


Attachments
modified /etc/rc script (not a proper patch file) (2.76 KB, application/octet-stream)
2020-09-09 10:36 UTC, unitrunker
no flags Details
/etc/rc supports rcorder -p for parallel startup. (2.09 KB, patch)
2020-09-10 05:23 UTC, unitrunker
no flags Details | Diff
/etc/rc supports rcorder -p for parallel startup. (2.09 KB, patch)
2020-09-15 18:20 UTC, unitrunker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description unitrunker 2020-09-08 11:41:44 UTC
This will be a patch to /etc/rc to optionally turn on the new '-p' option to run rc scripts in parallel. 

See: https://reviews.freebsd.org/D25389

/etc/rc currently does not support output from 'rcorder -p'.

Make parallel startup optional by an entry in /etc/rc.conf:

rc_parallel_start="YES"

This name mirrors the current, existing variable "jail_parallel_start" that allows jails to start up in parallel. See rc.conf(5).

Acceptance criteria 1:

rc_parallel_start="YES" causes /etc/rc to pass '-p' option to rcorder in the early and late passes. An rc_parallel_start that is undefined, "NO" or any value other than "YES" (using checkyesno) will cause /etc/rc to omit the '-p' option to rcorder.

Acceptance criteria 2:

If rcorder returns multiple script paths per line separated by a space, /etc/rc will execute each script - with each script path passed to run_sc_script - as a background task. This behavior is independent of the rc_parallel_start option.

Acceptance criteria 3:

After processing each line of output from rcorder, /etc/rc will pause by calling 'wait' to allow all rc script tasks to complete before proceeding to the next line of output from rcorder. This behavior is independent of the rc_parallel_start option.

Note: in the future, parallel start-up may become the default. This does not eliminate the need for the rc_parallel_start variable. Supporting rc_parallel_start="NO" in /etc/rc.conf will remain useful for debugging rc scripts.

Patch as attachment is forthcoming.

Similar changes to /etc/rc.suspend and /etc/rc.resume are out-of-scope. Patches will be submitted separately.
Comment 1 unitrunker 2020-09-09 10:36:40 UTC
Created attachment 217835 [details]
modified /etc/rc script (not a proper patch file)
Comment 2 unitrunker 2020-09-10 05:23:04 UTC
Created attachment 217864 [details]
/etc/rc supports rcorder -p for parallel startup.
Comment 3 unitrunker 2020-09-15 16:56:31 UTC
Ouch! Forgot the '&' to run as background when I consolidated the patch file.
Comment 4 unitrunker 2020-09-15 18:20:11 UTC
Created attachment 217979 [details]
/etc/rc supports rcorder -p for parallel startup.