Date: Wed, 27 Dec 2006 13:15:34 +0000 (UTC) From: Yar Tikhiy <yar@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/etc rc.subr Message-ID: <200612271315.kBRDFZYI012782@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
yar 2006-12-27 13:15:34 UTC FreeBSD src repository Modified files: etc rc.subr Log: 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 Revision Changes Path 1.72 +198 -146 src/etc/rc.subr
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612271315.kBRDFZYI012782>