From owner-freebsd-rc@FreeBSD.ORG Tue Feb 7 06:13:12 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 A262E16A420; Tue, 7 Feb 2006 06:13:12 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 458A243D48; Tue, 7 Feb 2006 06:13:12 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id k176DBA4023907; Mon, 6 Feb 2006 22:13:11 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id k176DBCx023906; Mon, 6 Feb 2006 22:13:11 -0800 Date: Mon, 6 Feb 2006 22:13:11 -0800 From: Brooks Davis To: Doug Barton Message-ID: <20060207061311.GC8667@odin.ac.hmc.edu> References: <43E8305F.9020505@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="adJ1OR3c6QgCpb/j" Content-Disposition: inline In-Reply-To: <43E8305F.9020505@FreeBSD.org> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-rc@freebsd.org Subject: Re: rc.conf.d support for local_startup directories? 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, 07 Feb 2006 06:13:12 -0000 --adJ1OR3c6QgCpb/j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2006 at 09:30:07PM -0800, Doug Barton wrote: > Howdy, >=20 > A post on -ports recently, and some other stuff I've been working on got = me > thinking. Is there any reason not to offer rc.conf.d support in the > local_startup directories? I think that this would simplify a lot of issu= es, > port authors could install the file with appropriate defaults, then > deinstall it when they are done. No more messy stuff left over after a po= rt > is deinstalled. What messy stuff? > The only disadvantage I can see to this is that because of how the conf > sourcing code is written, the variables in a file in an rc.conf.d directo= ry > will always override those in /etc/rc.conf[.local]. This could lead to two > problems, one would be a potential POLA violation, the other is that there > is a convenience factor now in just putting port_enable=3Dyes in > /etc/rc.conf.local, and having it still be there after you install the po= rt. > If rc.conf.d support became more widespread for ports, then users would h= ave > to either re-enable that port at every install, or (more likely) port > authors would start enabling their port by default. One could make the > argument that this is reasonable behavior, so I'm not sure this is a prob= lem > per se, just something to consider. Deleting a config file that has modified by the user is wrong, unless we add a really-really-delete option for pkg_delete and new plist directives to go with it. If I had to reconfigure my daemons after each update I'd be really pissed. > There is at least one way around this problem that I can see off hand, bu= t I > thought I'd throw it open for discussion first and see what people think. > I've attached the simplest implementation I could think of to start the > discussion. I really don't like this idea, or at least your proposed use of it. It's exactly the sort of thing we got away from in the base when /etc/default/rc.conf was created. If we want defaults for ports that aren't stuffed into rc.d scripts, we should create ${PREFIX}/etc/defaults/rc.conf.d/. There's something to be said for that since it would left us have /etc/defaults/rc.conf style comments for variables. > Index: rc.subr > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /usr/local/ncvs/src/etc/rc.subr,v > retrieving revision 1.47 > diff -u -r1.47 rc.subr > --- rc.subr 10 Dec 2005 20:19:08 -0000 1.47 > +++ rc.subr 7 Feb 2006 03:50:33 -0000 > @@ -876,10 +876,12 @@ > fi > _rc_conf_loaded=3Dtrue > fi > - if [ -f /etc/rc.conf.d/"$_command" ]; then > - debug "Sourcing /etc/rc.conf.d/${_command}" > - . /etc/rc.conf.d/"$_command" > - fi > + for dir in /etc $local_startup; do > + if [ -r "${dir%/rc.d}/rc.conf.d/$_command" ]; then > + debug "Sourcing ${dir%/rc.d}/rc.conf.d/${_command}" > + . "${dir%/rc.d}/rc.conf.d/$_command" > + fi > + done > =20 > # XXX - Deprecated variable name support > # If we've going to do this, we might consider deprecating local_startup and creating a new local_startup_prefixes or similar to get the etc/rc.d parts of the paths out of the way since we're planning to desupport non-rc.d scripts at some point in the future. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --adJ1OR3c6QgCpb/j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFD6Dp2XY6L6fI4GtQRAuC7AJ4iVa33VomBhSMkwCsHHuYgfxue8wCg14uB /0z81wTP0VZUfMZuLyoPWV0= =hgou -----END PGP SIGNATURE----- --adJ1OR3c6QgCpb/j--