Subject: Re: [Q] "safe" way to shutdown a server remotely
To: Henry Nelson <henry@irm.nara.kindai.ac.jp>
From: Jon Lindgren <jlindgren@espus.com>
List: netbsd-help
Date: 03/08/2000 07:16:11
On Wed, 8 Mar 2000, Henry Nelson wrote:

> Thanks to you all, and the NetBSD team, I have a NAT gateway machine
> tucked away and humming along with no monitor or keyboard attached.
> It's a dream of about a year come true.
> 
> I'll be leaving the power on most of the time, but when I do shut it
> down, I'd sort of like it to:
>    1) Not shutdown if one of the subnet machines is sending packets
>       through the gateway.  It would be nice if it would inform me
>       what machine it is waiting for.
>    2) Make sure I am logged off before it shuts down; not just a
>       simple delay mechanism.
> 
> Where does one look for scripts to do these kinds of things?  TIA

I don't know of any existing packages which do this... others might have
more to say on this.

In terms of waiting for conditions, you'd probably have to write a wrapper
script of sorts.  To solve 1), you could poll the status of the IPNAT vars
(I'm not in front of _any_ NetBSD box now [sigh], but I seem to remember
there is a way to display outstanding connections which are being
NATed).  To solve 2), you can probably just grab the terminal you logged
in on (tty) and poll until that's free.  The man pages for ipfstat (8) and
ipnat (8) might give you some leads.

There are definitely more [better] ways.  Just my $0.02

-Jon
 --------------------------------------------------------------------
 "Can you count my penny?" | NetBSD on i386, Alpha, VAX, NeXT, SPARC,
 "One!"                    | Mac68k, and hopefully more...