From owner-freebsd-rc@FreeBSD.ORG Fri Feb 23 06:34:29 2007 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 271B716A401; Fri, 23 Feb 2007 06:34:29 +0000 (UTC) (envelope-from vd@datamax.bg) Received: from jengal.datamax.bg (jengal.datamax.bg [82.103.104.21]) by mx1.freebsd.org (Postfix) with ESMTP id CB38113C48D; Fri, 23 Feb 2007 06:34:28 +0000 (UTC) (envelope-from vd@datamax.bg) Received: from qlovarnika.bg.datamax (qlovarnika.bg.datamax [192.168.10.2]) by jengal.datamax.bg (Postfix) with SMTP id 13EFAB848; Fri, 23 Feb 2007 08:34:28 +0200 (EET) Received: (nullmailer pid 96333 invoked by uid 1002); Fri, 23 Feb 2007 06:34:28 -0000 Date: Fri, 23 Feb 2007 08:34:28 +0200 From: Vasil Dimov To: Brooks Davis Message-ID: <20070223063428.GA96292@qlovarnika.bg.datamax> References: <20070222172658.GA40593@qlovarnika.bg.datamax> <20070222222526.GA90840@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <20070222222526.GA90840@lor.one-eyed-alien.net> Cc: freebsd-rc@freebsd.org Subject: Re: Setting rc scripts default values X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vd@FreeBSD.org 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: Fri, 23 Feb 2007 06:34:29 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 22, 2007 at 16:25:26 -0600, Brooks Davis wrote: > On Thu, Feb 22, 2007 at 07:26:58PM +0200, Vasil Dimov wrote: > > Hi, > >=20 > > Is there any special reason to write the rc scripts this way: > >=20 > > load_rc_config "$name" > > : ${rsyncd_enable=3D"NO"} > >=20 > > instead of this way: > >=20 > > rsyncd_enable=3D"NO" > > load_rc_config "$name" > >=20 > > apache does it this way: > >=20 > > apache_enable=3D${apache_enable-"NO"} > > load_rc_config $name > >=20 > > but I think it can safely be changed to > >=20 > > apache_enable=3D"NO" > > load_rc_config $name > >=20 > > What did I miss... >=20 > load_rc_config doesn't reread /etc/rc.conf every time. Hmmz, I see that load_rc_config() does not reread /etc/rc.conf only if _rc_conf_loaded is set. The only place where _rc_conf_loaded is set is in load_rc_config() itself after it reads /etc/rc.conf. load_rc_config() is not called anywhere in rc.subr [1]. Can you show me a scenario where this code: =2E /etc/rc.subr rcvar=3D`set_rcvar` foo_enable=3D"NO" load_rc_config ${name} # foo_enable=3D"YES" is in /etc/rc.conf ends up with foo_enable=3D"NO"? Thanks. [1] actually it is called from load_rc_config_var() but in a subshell. --=20 Vasil Dimov gro.DSBeerF@dv % Testing can show the presense of bugs, but not their absence. -- Edsger W. Dijkstra --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFF3or0Fw6SP/bBpCARAtmGAKDh4iwuKYlcXYQqwAL4rbzwZKcvHgCdGw/y POzlu2q3pDsW4D2W8zSwWi4= =LbQZ -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--