Subject: Re: Proposed rc.d changes....
To: Luke Mewburn <>
From: Darren Reed <>
List: tech-userlevel
Date: 05/01/2000 07:08:44
In some email I received from Luke Mewburn, sie wrote:
> Details:
> 1. Using `shutdown' instead of `stop' as the argument to rc.d scripts at
>    shutdown(8) time. (Simon Burge posted about this last week)
> 	The rationale for this is that for a couple of reasons
> 	(including speed and system stability in the case of potential
> 	deadlock), having all of the rc.d scripts run with an argument
> 	of `stop' at shutdown is not necessarily the best idea.

To me, "stop" and "shutdown" are the same, from an rc script point
of view.  The key here, I think, is that the arg being given to the
script is a `verb' for it to act on and not something which is meant
to tell it about the system state.

So passing "shutdown" to an rc script with the intent of "shutdown"
meaning that the system is shutting down is, IMHO, wrong.  At the
other end, there isn't (and I don't believe there should be) a "boot"
word for starting services after bootup which is used differently to
"start".  Telling a script to "start", "stop", "reload", "restart",
are all fine.  Another problem I have with this passage of information
is that I can do "/etc/rc.d/named shutdown" anytime I want, even without
shutting down the box.  If I can do that, then what meaning does this
extra parameter really have ?  I think what is being described is what
you might put in a local script called "fast-shutdown" (or whatever) -
it only runs the scripts you want run in shutting down.

If you are desperate to do a quick shutdown, then you'll "stop" the
critical services yourself (databases, etc), do "halt", etc, and
avoid scanning through all the rc scripts anyway.  It may be that
you want to avoid the scripts which get run with "shutdown", anyway.
Don't forget that in the case of fire to use "fasthalt" :-)

So, in short, I think we should stick with using "stop", not implement
"shutdown" and recommend people keep fire extinguishers nearby in case
their hard drives catch on fire :-)  To me, adding "shutdown" and having
it different to "stop" is a real case of "creeping featurism" with no
significant gains but possible confusion later on as people learn that
"stop" isn't "stop" on NetBSD in all cases...

> 	A suggestion has been to change /etc/rc.shutdown to call
> 	the /etc/rc.d/ scripts with `shutdown' instead of `stop'.
> 	That way, manual control of scripts is still possible, but
> 	only those scripts which explicitly need to be shutdown
> 	(e.g, xdm) are done so. Everything else will just rely upon
> 	the SIGTERM from init(8).

That seems to be opposite to the purpose of rc scripts.  I thought
they were all meant to shut things down themselves and not leave it
up to responding to SIGTERM from init.

Something eles I'd like to be able to do, which would take support
from init(8), is to be able to do "shutdown now" from my xterm and
have it go to single user mode with the console redirected to my
xterm (or at least not kill the xterm & shell).