Review request: fixing /usr dependencies in rc.d/var
Mike Makonnen
mtm at identd.net
Fri Oct 15 03:40:21 PDT 2004
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).
> ==== //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.
Cheers.
--
Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm at identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55
mtm at FreeBSD.Org| FreeBSD - Unleash the Daemon !
More information about the freebsd-rc
mailing list