[comp.unix.admin] Powerfailure daemon ???

mds@iddth.id.dk (Impedantzer (EMP)) (04/11/91)

I am posting this request for help/inspiration on behalf of a friend
of mine with no connection to the network community. He is working in 
a company where they use a HP 375 Unix box for datalogging. It is
vital that the machine is shut down in a controlled manner (i.e. closing
all open files, etc.) in case of a powerfailure. For that reason they have an
UPS powersupply capable of keeping til machine going fore an hour or so.  
Well, so much for the background story.

Here comes the interesting part: they have the UPS but they *don't* have
the daemon to shut down the machine. Are there anybody out there 
with a similar system willing to share his/her knowledge with my 
friend? Perhaps a sample program og something like that. The general idea
is that the daemon reacts on an interrupt from the UPS.

-- Michael

PS. We don't have a system like the above mentioned here at the Dep. of CS,
so when the power goes it's gone!!

_________________________________________________________________________
Michael Dantzer-Sorensen              e-mail: mds@id.dth.dk
Department of Computer Science        Tel. +45 45 93 12 22 ext. 3761
Building 344 & 345                    Fax. +45 42 88 45 30
Technical University of Denmark
DK-2800 Lyngby
_________________________________________________________________________

ostroff@Oswego.EDU (Boyd Ostroff) (04/12/91)

In article <mds.671373695@iddth2> mds@iddth.id.dk (Impedantzer (EMP)) writes:
> He is working in 
>a company where they use a HP 375 Unix box for datalogging. It is
>vital that the machine is shut down in a controlled manner (i.e. closing
>all open files, etc.) in case of a powerfailure.

>Here comes the interesting part: they have the UPS but they *don't* have
>the daemon to shut down the machine.

Sure, see the recently posted "upsd" program in comp.sources.misc; it does
exactly what you want!  Also, you might look up the "Wizard's Grabbag"
article entitled "Graceful UPS Shutdowns and Calendar Cleanup" on page
119 of the February 1990 issue of UNIX WORLD Magazine.

It details a very simple hardware project which can provide a power failure
signal for the garden-variety (eg: cheap) UPS and also the software needed
to monitor it.  By combining the information in this article and the
upsd program from comp.sources.misc, anyone should be able to implement
a very nice system like this for a modest cost.  I plan to (when I get
the time.... :-)

||||  Boyd Ostroff / Tech Director / SUNY Oswego Dept of Theatre / 315-341-2987
||||  Sys Admin at cboard.UUCP / Serving the Performing Arts / 315-947-6414/8N1
||||  ostroff@oswego.oswego.edu / cboard!ostroff@natasha.oswego.edu

art@pilikia.pegasus.com (Art Neilson) (04/13/91)

In article <mds.671373695@iddth2> mds@iddth.id.dk (Impedantzer (EMP)) writes:
>Here comes the interesting part: they have the UPS but they *don't* have
>the daemon to shut down the machine. Are there anybody out there 
>with a similar system willing to share his/her knowledge with my 
>friend? Perhaps a sample program og something like that. The general idea
>is that the daemon reacts on an interrupt from the UPS.

I recently wrote and posted such a daemon to comp.sources.misc.  It is 
written for system 5, if you are on a BSD system you'd have to hack it
a bit.  My UPS has a serial port and I've cabled it to a tty on my UNIX
box.  It raises DCD when it goes on battery backup power, and it drops
DCD when it goes back to online power.  That's enough to build a daemon
around.  You need to find out how your UPS signals power loss and power
restored in order to write a daemon.  Send me email if you have any
questions regarding the daemon I wrote.
-- 
Arthur W. Neilson III		| INET: art@pilikia.pegasus.com
Bank of Hawaii Tech Support	| UUCP: uunet!ucsd!nosc!pilikia!art

lars@iclswe.icl.se (Lars Tunkrans) (04/13/91)

mds@iddth.id.dk (Impedantzer (EMP)) writes:

>Here comes the interesting part: they have the UPS but they *don't* have
>the daemon to shut down the machine. Are there anybody out there 
>with a similar system willing to share his/her knowledge with my 
>friend? Perhaps a sample program og something like that. The general idea
>is that the daemon reacts on an interrupt from the UPS.

What you need is contained in the February 1990 issue of UNIXWORLD,
the Wizards grabbag column.

Listings of the programs therein is available at uunet.

path is  uunet!~/unix-world/grabbag/1990/feb90.Z

I dont have this sources on line but can fax to you if absolutley 
nessesary ( Denmark is not to far away from here ).

Lars.
-- 
Lars Tunkrans  Phone +46 (0)76096368. |                 I C L 
      DRS Systems Support.            |    
UUCP: uunet!mcsun!sunic!iclswe!lars   |   The leading UNIX System V Release 4.0
DOMAIN Address : lars@iclswe.icl.se   |              integrator.