]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rc: improve NAME_setup handling
authorFranco Fichtner <franco@opnsense.org>
Fri, 24 May 2024 16:38:56 +0000 (18:38 +0200)
committerWarner Losh <imp@FreeBSD.org>
Wed, 29 May 2024 17:23:46 +0000 (11:23 -0600)
commit11333dd580b704fb4ff0836e1d1a0634099b0cf6
treecac5a62b3a56f72a46d82e5b345d4f77426791b2
parentb661d9e64d73a244873fb2aa6c97e95a988fb758
rc: improve NAME_setup handling

Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd may use configuration checks and blocks setup
from doing its designated work (e.g. nginx).  In moving
the invoke of the setup script in front allows us to
provide custom scripts for config file generation and
fixing prior to precmd checking configuration integrity.

Also introduce _run_rc_setup to separate the launcher
from the main one.  Let it run correctly in the case
of restart_precmd and block further execution as
would be the case in start due to the internal plumbing
of restart being split into calling stop and start
afterwards.

Differential-Revsiion: https://reviews.freebsd.org/D36259
Signed-off-by: Franco Fichtner <franco@opnsense.org>
Reviewed by: imp, oshogbo
Pull Request: https://github.com/freebsd/freebsd-src/pull/1258
libexec/rc/rc.subr
share/man/man8/rc.subr.8