Subject: Re: Not the standard rc.d complaint
To: None <current-users@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 04/09/2000 01:08:13
[ On Saturday, April 8, 2000 at 21:40:33 (-0500), Dave Huang wrote: ]
> Subject: Not the standard rc.d complaint
>
> If I'm telnetted/sshed into a machine and do a "shutdown -r now", the
> rc.d/network script says "Downing network interfaces:" and proceeds to
> do exactly that. Which leaves me with a hung ssh session that I have to
> manually close, and bunch of other hung TCP connections that may
> eventually time out and die (or may not if they don't send anything).
> This is annoying :) With the Old Way, the kernel would RST all
> connections before it shut down.

That's one of the annoying things indeed.  Another is if your home
directory happens to be an NFS mount and you happen to do the shutdown
from there.  Watch out for lots of stupid messages about ignoring NFS
errors.

Some things don't need to be stopped before the kernel is halted or
before init is commanded to kill outstanding processes (especially when
it does some shutdown tasks of its own such as resetting open TCP
connections!).

I'm not sure how to reconcile this with the need to have support for
shutting down such things when an rc.d script is explicitly invoked to
do so from the command line though.  Perhaps the shutdown command could
export a variable to the environment to indicate that it's really going
to halt or reboot the machine and that some shutdown hooks can be
skipped since init and/or the kernel takes care of them.

It took the SysV folks quite some time to learn some of these lessons.
Let's not repeat their learning curve again -- we should be able to ramp
up much faster with this hindsight and the collective experience of
everyone in this forum.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>