[comp.sys.hp] How do I shutdown an HP9000/332 on orders from a UPS.

jack@cscdec.cs.com (Jack Hudler) (01/08/91)

We have just installed a UPS for our network and HP9000.
I have connected the UPS (BEST) to an unused serial port, and I am able
to talk to it and know when power has failed.
But what I don't know how to handle is shutting down the HP9000 gracefully
without operator intervention. 
A sequence of events would be, Loss of power, wait 6 minutes for Novell
server to shutdown (via relay connections), order the UPS to shutdown 
in 1 minute and then reboot -h the HP9000. (this assumes power is not
restored before Novell server goes down)
This would at least make sure the power would be cycled to reboot the Novell
server.

Is reboot -h too ruthless? (I think it is)

Is there a PD version of UPS monitoring software out there?

Thanks,
-- 
Jack           Computer Support Corporation             Dallas,Texas
Hudler         Internet: jack@cscdec.cs.com

jewett@hpl-opus.hpl.hp.com (Bob Jewett) (01/12/91)

> Is reboot -h too ruthless? (I think it is)

If your software is written to exit gracefully on some signal
(SIGTERM==15, for example), you could try sending that to all such
processes, wait a little, and then reboot -h.  The man page for reboot
does not specify which signal it uses to kill processes, but I suspect it
is 9, which cannot be caught.

Bob

briand@sumax.seattleu.edu (Brian Daugherty) (01/14/91)

In article <98@cscdec.cs.com> jack@cscdec.cs.com (Jack Hudler) writes:
>We have just installed a UPS for our network and HP9000.
>I have connected the UPS (BEST) to an unused serial port, and I am able
>to talk to it and know when power has failed.
>But what I don't know how to handle is shutting down the HP9000 gracefully
>without operator intervention. 
>
>Is there a PD version of UPS monitoring software out there?
>

I couldn't tell from your posting, but are you aware of the generic UNIX
C program supplied (at a small fee) by BEST just for this purpose?  It is
supposed to run on the HP, and monitors the serial port every couple   
minutes.  When power is interrupted, the program detects this, and lets
you do whatever you want to shut down the UNIX system.  We plan to start
a modified "shutdown" script, ending with reboot -h, after stopping all
other processes.
We haven't installed all this and made it work, but we have the hardware 
and software, and an approach that ought to work.  You can also help reach
your scenario by changing the settings in the UPS that control how long the
UPS will run after AC-line interrupt, whether it will restore power when AC
returns, etc.
Sounds like we have similar setups and needs (BEST UPS, HP9000, Novell).
Stay in touch; we can probably both benefit.
NOTES:  the BEST software comes as source on DOS 5 1/4" disks, with a manual
        for installation and customization.  It is cheap (<$100) compared to
the UPS, anyway.
Hope this helps,
Brian 
NUWES
(student at Seattle U)

alan@km4ba.UUCP (Alan Barrow) (01/15/91)

In regard to various signals, I seem to remember that you
can specify which signal to use from killall. Since I
believe that shutdown uses killall, you could do a "lightweight"
kill, wait a while, then do a serious kill (-9, which is default
for killall, I think).

Again, you are dealing with the lesser of evils:
   (your program)-
   hostile termination
      VS
   (powerfail w/o shutdown)-
   multiple hostile termination
   unclean disks
   etc.

BTW, there is a signal associated with pwrfails. Your 
UPS watcher could send this signal to init. init then
takes action with a new state, and a script.

It is discussed in init(1m), I believe.

Good Luck!

Alan Barrow (km4ba)
..!gatech!kd4nc!km4ba!alan

These thoughts are mine, not my employer's!