From owner-freebsd-rc@FreeBSD.ORG Sat Oct 16 04:22:49 2004 Return-Path: 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 8102216A4CE for ; Sat, 16 Oct 2004 04:22:49 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BB9943D2F for ; Sat, 16 Oct 2004 04:22:49 +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 i9G4MoBl005418; Fri, 15 Oct 2004 21:22:50 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i9G4Mndp005417; Fri, 15 Oct 2004 21:22:49 -0700 Date: Fri, 15 Oct 2004 21:22:49 -0700 From: Brooks Davis To: Mike Makonnen Message-ID: <20041016042249.GA5160@odin.ac.hmc.edu> References: <20041005232714.GA18350@odin.ac.hmc.edu> <20041015103940.GA4766@rogue.acs.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <20041015103940.GA4766@rogue.acs.lan> 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: rc@freebsd.org Subject: Re: Review request: fixing /usr dependencies in rc.d/var X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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: Sat, 16 Oct 2004 04:22:49 -0000 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 15, 2004 at 01:39:40PM +0300, Mike Makonnen wrote: > Again, sorry for the late reply. >=20 >=20 > On Tue, Oct 05, 2004 at 04:27:14PM -0700, Brooks Davis wrote: > > I'm trying to get the /usr dependencies out of rc.d/var. The patch > > below does everything except dealing with mtree (I think we're going to > > end up moving mtree to /sbin). This change causes two behavior changes. > >=20 > > - If you delete one of the files now marked with a C, it will come > > right back next time you boot unless you remove the C. I don't think > > this is a big deal, but it may bite a user or two if they don't use > > mergemaster or read UPDATING. > >=20 > > - Second, if you are booting diskless, only the files marked with C's > > or those created elsewhere (wtmp, lastlog, sendmail.st) will be > > created at boot instead of all the files. The old behavior can be > > returned by adding C's to the flags or change newsyslog_flags to -CCN. > >=20 > > Any comments? >=20 > Sounds good to me. >=20 > > =20 > > # PROVIDE: newsyslog > > -# REQUIRE: mountcritremote sysdb > > -# BEFORE: syslogd SERVERS > > +# REQUIRE: cleanvar mountcritremote > > +# BEFORE: syslogd > > +# KEYWORD: FreeBSD > > =20 > > . /etc/rc.subr > > =20 > > name=3D"newsyslog" > > -rcvar=3D$name > > +start_cmd=3D${newsyslog_program} >=20 > You don't need a start_cmd if all you're doing is calling the > command itself. Furthermore, you don't need to explicitly set > $newsyslog_program. rc.subr(8) will pick it up automatically (it > automatically picks up ${name}_program). I've new a new version of this that does use a real start command (it's more like the previous version). > > =3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/sendmail#6 (text+ko) = =3D=3D=3D=3D > >=20 > > @@ -69,6 +69,10 @@ > > "${name}: /etc/mail/aliases.db not present, generating" > > /usr/bin/newaliases > > fi > > + > > + if [ ! -f "/var/log/sendmail.st" ]; then > > + /usr/bin/touch /var/log/sendmail.st > > + fi > > } > > =20 > > run_rc_command "$1" > >=20 > > =3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/sysdb#2 (text+ko) =3D= =3D=3D=3D > >=20 > > @@ -30,6 +30,15 @@ > > # not be available then (possibly no /usr). > > # > > install -c -m 664 -g utmp /dev/null /var/run/utmp > > + > > + # Make sure lastlog wtmp exist. They might not be there if > > + # we are booting diskless. > > + if [ ! -f /var/log/lastlog ]; then > > + install -m 644 /dev/null /var/log/lastlog > > + fi > > + if [ ! -f /var/log/wtmp ]; then > > + install -m 644 /dev/null /var/log/wtmp > > + fi > > } > > =20 > > load_rc_config $name >=20 > What's sendmail.st? The rc.d/sysdb script is not used in FreeBSD, so you > can probably get rid of the two above patches. It's the sendmail statistics file. rc.d/sysdb needs to run in a diskless environment. If it isn't running now I will enable it. There are scripts that depend on it. Having a utmp, lastlog, and wtmp is non-optional. -- 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 --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBcKIZXY6L6fI4GtQRArRkAJ9xEPzXY5tL6zh/fAIKRwP25CjAowCaAjOj Lfe6ziamQyJpAWakiApPqjA= =/acM -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--