HomeFreeBSD

rc: Remove rc_fast_and_loose

Description

rc: Remove rc_fast_and_loose

The rc_fast_and_loose variable allowed rc(8) to start services
by sourcing them into rc's own shell environment. Normally, each rc
service script is started by being sourced into its own subshell
instead. The feature was meant to speed up rc(8) by avoiding the extra
forking necessary to spawn subshells.

In practice, the feature has been broken for a long time now. One of the
reasons is that some rc service scripts call the exit builtin to return
non-zero error codes, which not only terminates the service subshell
but also rc(8) when rc_fast_and_loose is enabled. For example,
a system running any of the supported FreeBSD releases
with rc_fast_and_loose=yes would abort rc(8) as early as rc.d/hostid,
due to an "exit 0".

Fixing rc_fast_and_loose support would require rewriting some rc scripts
to support being sourced directly into rc(8) process. This would muddy
the code base and also would prove difficult to maintain long term
as this is simply not how rc(8) users write scripts. The potential
performance benefits are unlikely to be significant even for use cases
such as Morello under qemu.

Instead, remove support for rc_fast_and_loose completely from rc(8)
and inform users about the change.

PR: 282255
Reviewed by: brooks, christos, mhorne
Approved by: christos (mentor), markj (mentor)
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D47264

Details

Provenance
0mpAuthored on Wed, Oct 23, 12:57 PM
Reviewer
brooks
Differential Revision
D47264: rc: Remove rc_fast_and_loose
Parents
rG10c429016a3c: stand: Ugly hack due to default change
Branches
Unknown
Tags
Unknown