Subject: Re: PROPOSAL: /etc/rc, /etc/init.d/*, ...
To: None <lukem@cs.rmit.edu.au>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: tech-userlevel
Date: 12/01/1999 20:34:04
In some email I received from Luke Mewburn, sie wrote:
[...]
> A new system should have the following attributes:
> * Separate scripts for each function, which support
> `start' and `stop' type functionality.
How about `status' too ?
0 = started successfully
1 = failed to start
2 = starting (not completed)
3 = not configured to be started (/etc/rc.conf turned this script off
but it's still in /etc/rc3.d because mkrc hasn't been rerun)
"reload/restart" would be another useful one.
I'd consider both of those as "must have" before adding this to
NetBSD, based on what's in the marketplace today.
> * The ability to generate /etc/rc and /etc/rc.shutdown
> from `/etc/init.d/*'.
Good.
> * Implementers should be able to add extra actions to a
> script (e.g, `reload', `debugon', etc) fairly easily.
Any `additions' should be standard across all scripts which are
NetBSD derived (vs 3rd party) - even if they're null ops so that
invalid actions always return errors.
[...]
> NOTE: During development this directory was called `/etc/rc.d'.
> It was changed to `/etc/init.d' because:
> a) prior art (cf. SYSV), and people are used to running
> /etc/init.d/foo start
Or /etc/rc2.d/foo start
And what about /etc/rcS.d ?
> c) /etc/rc.sh
>
> A script which effectively does:
> for i in `rcorder /etc/init.d/*`; do
> $i faststart
> done
> (`faststart' is like start but without the check for
> running processes).
>
> If a user wants to use this method (instead of having to
> rebuild /etc/rc when necessary), just symlink /etc/rc.sh
> to /etc/rc.
"faststart" seems like a bad idea to me. It seems to me something
like what you'd use in testing, but that's about it. Or maybe you'd
use it when booting a vax so that it boots `today' ;) Granted this
is pretty much what we do today, but who's to say that's something
to brag about ? :->
[...]
> ====
> # PROVIDE: mountd
> # REQUIRE: beforemountlkm network portmap
Is that meant to mean "before mountlkm" or "before mount lkm" ? Or is
"beforemountlkm" really the name of a single script ? If it's the latter
then the name just sucks. If either of the former, split it up.
On the whole good, but I've got one major criticism:
in an effort to not piss anyone off (too much) there's too much fence
sitting being done. I don't mind the /etc/rc still being supported
(the everything in one script version) but the rest is of concern.
There's an /etc/rcX.d which gets used sometimes and an /etc/init.d
which also gets used sometimes. It's possible to have a /etc/rcX.d
populated but then ignored by a script which independantly interrogates
scripts in /etc/init.d. From a featurism point of view, sure, it's
great that we've got all these features, but I think these two are
competing with each other and offer no real long term benefit. We
need to pick one and go with it. I think this is trying to be everything
to everyone and ultimately we'll lose.
Darren