Cheap or free auto-shutdown setup (was: Reliability Sys V file sys)

Julian Macassey julian at bongo.UUCP
Tue Oct 2 02:39:30 AEST 1990


In article <1030 at bilver.UUCP>, bill at bilver.UUCP (Bill Vermillion) writes:
> In article <1990Sep29.220137.6550 at intek01.uucp-> mark at intek01.uucp (Mark McWiggins) writes:
> ->rdc30med at nmrdc1.nmrdc.nnmc.navy.mil (LCDR Michael E. Dobson) writes:
> ->[about a $250 autoshutdown monitor]
> ->
> ->The shell script to listen on the port and do the shutdown seems trivial;
> ->I'll post a copy of mine when I get it done, unless somebody beats me to it.
> 
> Why couldn't you just use a cheap relay connected to the mains power
> source.  Then connect pins 2 & 3 of the rs232 to a pair of contacts that
> are closed when power is on.  Then just send something out and see if it
> echos.  If it doens't come back to you, the power is off!
> 
> Or am I really overlooking something here?:

	Getting the "Edison is still making 60Hz waves" signal into the 
computer can be accomplished any number of ways. All of the above will 
work as will a photocell in a shoebox with a 15W light bulb. When the 
light goes out, we assume the power died etc. In fact the simplest way 
to do this is get a surplus "Plug-it-in-the-wall" DC supply of the 
type sold with calculators. Find a 9 -12V DC one and put a DB-25 on 
the DC end. Wire it so it asserts DSR. Or any damn pin you want as 
long as the system can look at it. When the power fails, it goes off 
(low). Then the computer knows that the power is down.

	That much is easy. This is the hard part. You now need a shell script 
to invoke shutdown before the UPS dies and negates the advantage of 
having one. But invoking shutdown, will still leave the system sitting 
there waiting for either a human to turn off the machine or the UPS 
power to die and cause havoc to the file system. Remember the purpose 
of this excercise is to prevent instant power loss damage.

	So what you have to do now is recognise the "Switch off or reboot" 
signal and kill the power with a relay. Of course the system could 
also have smarts that would abort shutdown if the power returned in 5 
mins etc. 

	The next problem is bringing the system back up again. So you need a 
way to access the relay remotely - via phone for example. Or you need 
a smart device to see that Utility power is back for  a set length of 
time - say 10 mins - and then switch the system back on.

	The whole purpose of this excercise is to take care of those times 
when the sysop is ill or away. Obviously if you are staring at the 
console and the room lights go out and the UPS kicks in, you know what 
to do.

	So to summarise, here is what needs to be done:

1.	Identify a power outage

2.	Start shutdown

3.	Abort shutdown, or reboot if power returns within a specified 
period.

4.	Switch off machine after shutdown is successful

5.	Switch machine back on after power has been restored for a certain 
length of time.

-- 
Julian Macassey, n6are  julian at bongo.info.com  ucla-an!denwa!bongo!julian
N6ARE at K6IYK (Packet Radio) n6are.ampr.org [44.16.0.81] voice (213) 653-4495



More information about the Comp.unix.sysv386 mailing list