From owner-freebsd-rc@FreeBSD.ORG Tue Jul 25 21:05:36 2006 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 825F916A4DE; Tue, 25 Jul 2006 21:05:36 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F46043D55; Tue, 25 Jul 2006 21:05:35 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.4/8.13.3) with ESMTP id k6PKe1PS074858; Wed, 26 Jul 2006 00:40:02 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.3/Submit) id k6PKe1mb074853; Wed, 26 Jul 2006 00:40:01 +0400 (MSD) (envelope-from yar) Date: Wed, 26 Jul 2006 00:40:01 +0400 From: Yar Tikhiy To: Doug Barton Message-ID: <20060725204001.GC73669@comp.chem.msu.su> References: <20060722111449.GE10321@comp.chem.msu.su> <44C2687A.3030102@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44C2687A.3030102@FreeBSD.org> User-Agent: Mutt/1.5.9i Cc: freebsd-rc@FreeBSD.org Subject: Re: Generalising ${required_*} X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2006 21:05:36 -0000 On Sat, Jul 22, 2006 at 11:03:38AM -0700, Doug Barton wrote: > Yar Tikhiy wrote: > > Hi all, > > > > As of now, the ${required_*} variables work only in rc.d scripts > > using the default start method. I've found that making ${required_*} > > work in scripts that override the default start method can help us > > to reduce code duplication in /etc/rc.d. In particular, I'd like > > to introduce ${required_modules} because quite a few scripts have > > to have a prestart method just to load a kernel module. > > > > Do you think such change would make sense? Thanks. > > > > Its prototype can be found in my P4 tree: > > //depot/user/yar/hack/etc/... > > (also available via www at http://perforce.freebsd.org) > > For those of us who are p4 impaired, can you give us a URL to view the > changes you're proposing? Thank you for requesting this! It encouraged me to test my changes at last and prepare a good old patch :-) http://people.freebsd.org/~yar/required_modules.patch Its top part converts quite a few rc.d scripts to using $required_modules if possible or load_kld() otherwise in place of raw kldload. The respective changes to rc.subr and rc.subr.8 appear at the bottom of the patch. -- Yar