Review request: fixing /usr dependencies in rc.d/var
Brooks Davis
brooks at one-eyed-alien.net
Fri Oct 15 21:22:49 PDT 2004
On Fri, Oct 15, 2004 at 01:39:40PM +0300, Mike Makonnen wrote:
> Again, sorry for the late reply.
>
>
> 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.
> >
> > - 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.
> >
> > - 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.
> >
> > Any comments?
>
> Sounds good to me.
>
> >
> > # PROVIDE: newsyslog
> > -# REQUIRE: mountcritremote sysdb
> > -# BEFORE: syslogd SERVERS
> > +# REQUIRE: cleanvar mountcritremote
> > +# BEFORE: syslogd
> > +# KEYWORD: FreeBSD
> >
> > . /etc/rc.subr
> >
> > name="newsyslog"
> > -rcvar=$name
> > +start_cmd=${newsyslog_program}
>
> 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).
> > ==== //depot/user/brooks/cleanup/etc/rc.d/sendmail#6 (text+ko) ====
> >
> > @@ -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
> > }
> >
> > run_rc_command "$1"
> >
> > ==== //depot/user/brooks/cleanup/etc/rc.d/sysdb#2 (text+ko) ====
> >
> > @@ -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
> > }
> >
> > load_rc_config $name
>
> 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
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20041015/a6f07bad/attachment.bin
More information about the freebsd-rc
mailing list