summaryrefslogtreecommitdiffstats
path: root/share/man/man8/rc.subr.8
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-12-27 13:15:33 +0000
committeryar <yar@FreeBSD.org>2006-12-27 13:15:33 +0000
commitc6dfd2ef7a2c3c3bda8f05278c7e9d0cb0f21f8d (patch)
tree75f0b8d06233f0e674f95552816ee5ca0192febb /share/man/man8/rc.subr.8
parent0f6657a760d83f9eff326c79a5f42b3b8c45270b (diff)
downloadFreeBSD-src-c6dfd2ef7a2c3c3bda8f05278c7e9d0cb0f21f8d.zip
FreeBSD-src-c6dfd2ef7a2c3c3bda8f05278c7e9d0cb0f21f8d.tar.gz
MFp4:
Implement the checks for required_* objects as two functions, one to be run before precmd and the other after it. They get the current rc command as an argument so they can choose what requirement tests to perform. As of now, only "start" needs such tests. Implement a new requirement variable, required_modules. It can list kernel modules that need to be loaded after start_precmd indicated success. Each name in the list can be just "file", or "file:module", or "file~regex". This will allow us to remove a lot of duplicated code from rc.d scripts. Perform the checks not only for the default start method, but for any method. This allows for more flexibility and fixes a few rc.d scripts (namely newsyslog, pf, sendmail) that rely on a required_* variable while providing a non-default start method. To be able to call the new check_required* functions naturally, remove lots of crufty duplicated code pieces from run_rc_command and replace each of them by a call to the helper function providing a single corrected instance of the respective code snippet. Now run_rc_command isn't as scary as it used to be, and it even appears to have quite a nice logic that was obscured by the old crufty code. In the default handler for restart, run start from a subshell to protect global varibles, e.g., _postcmd, from modification by the start handler. This enables using restart_postcmd. [x] PR: conf/98734 [x] Submitted by: Rick van der Zwet <rick@wzoeterwoude.net> [x] Reviewed by: freebsd-rc (silence for an older version) MFC after: 1 month
Diffstat (limited to 'share/man/man8/rc.subr.8')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud