From owner-freebsd-arch@FreeBSD.ORG Tue Apr 29 10:28:10 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12BA737B401 for ; Tue, 29 Apr 2003 10:28:10 -0700 (PDT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 38B0343F93 for ; Tue, 29 Apr 2003 10:28:08 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 18076 invoked from network); 29 Apr 2003 17:22:24 -0000 Received: from sbnd.online.bg (HELO straylight.ringlet.net) (217.75.129.196) by gandalf.online.bg with SMTP; 29 Apr 2003 17:22:22 -0000 Received: (qmail 81183 invoked by uid 1000); 29 Apr 2003 17:25:44 -0000 Date: Tue, 29 Apr 2003 20:25:44 +0300 From: Peter Pentchev To: "Scot W. Hetzel" Message-ID: <20030429172544.GA80819@straylight.oblivion.bg> Mail-Followup-To: "Scot W. Hetzel" , freebsd-arch@freebsd.org, freebsd-rc@yahoogroups.com References: <20030426154030.M13476@znfgre.qbhto.arg> <009001c30dbc$684a2c10$13fd2fd8@Admin02> <20030429122242.GB680@straylight.oblivion.bg> <008401c30e71$3fade480$13fd2fd8@Admin02> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <008401c30e71$3fade480$13fd2fd8@Admin02> User-Agent: Mutt/1.5.4i cc: freebsd-rc@yahoogroups.com cc: freebsd-arch@freebsd.org Subject: Re: Removal of the old rc system from -current X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2003 17:28:10 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 29, 2003 at 12:03:21PM -0500, Scot W. Hetzel wrote: > From: "Peter Pentchev" > > From "Scot W. Hetzel" > >> I started porting my ports rc scripts to work on both rcNG and rcOG > systems. > >>In this process I found the ideal solution for the ports rc.d script: > >> > >> 1. define default port variables in the script > >> 2. check for /etc/rc.subr > >> a. if rc.subr exists, use rcNG style > >> b. if rc.subr not exists > >> 1. source /etc/defaults/rc.conf (or /etc/rc.conf) > >> 2. use rcOG style > > > >Actually, this ought to be more like: > >b. if rc.subr does not exist > >1. source /etc/defaults/rc.conf > >2. if the source_rc_confs function exists, execute it > >3. if the source_rc_confs function does not exist, > > try to emulate it by checking for the files listed > > in the rc_conf_files variable and sourcing them if > > they exist. >=20 > This is what I have in the rcOG portion of the script to bring in the > rc.conf settings: >=20 > # Suck in the configuration variables. > if [ -z "${source_rc_confs_defined}" ]; then > if [ -r /etc/defaults/rc.conf ]; then > . /etc/defaults/rc.conf > source_rc_confs > elif [ -r /etc/rc.conf ]; then > . /etc/rc.conf > fi > fi >=20 > Any changes I should make to it? None that I can think of, actually. The only issue that bothers me somewhat is that the above might miss an /etc/rc.conf.local; however, if /etc/defaults/rc.conf does not have source_rc_confs_defined, then we are clearly not on any reasonably recent FreeBSD system, so I don't know whether any assumptions should be made about the existence and relevance of /etc/rc.conf.local. On any reasonably recent FreeBSD system with rcOG, source_rc_confs_defined would be defined, and source_rc_confs() should take care of all the conf files. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 Thit sentence is not self-referential because "thit" is not a word. --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+rrWY7Ri2jRYZRVMRAklEAKClNzaJN4zk9ayEDzowVvkPolmHfACeOffA BJp8N709VS8lHVTkoku3uQo= =Ro6K -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw--