[lug] apm/UPS

D. Stimits stimits at idcomm.com
Fri Aug 2 12:45:41 MDT 2002

Peter Hutnick wrote:
>>I'm looking at an UPS for the Linux bridge and cable modem. Obviously,
>>cable modems do not have any "auto power down" feature (nor would the
>>modem need it, but not totally depleting a battery's power is good for
>>the life of the battery). In the case of the bridge machine, it is
>>older, and does not support having the o/s power itself down, it has a
>>good old-fashioned switch. However, in the case of the Linux machine, I
>>can probably rewrite some of the UPS scripts for apmd, so that it starts
>> out by changing the ext3 journal speed from 5 second intervals to 1
>>second intervals; and then if time goes far enough, either remount the
>>drives read-only, except for /var/, or else run init 0 to halt when
>>things get really close.
> Have you looked into an RS-232 controlled relay?  You'd have to figure out
> how to get your UPS to talk to the server (to do init 0) and the relay (to
> kill power some reasonable period later), but I think it is quite doable.

Ideally, I will call rwall to all connected machines (it is a bridge for 
a cable modem to different machines) to announce power problems, plus 
any other normal behavior. The rs-232 relay is a nice idea, but may run 
into other "gotchas". The power on the computer itself would have to be 
cut first, without generating lethal spikes (perhaps not as easy as it 
sounds, normal surge suppressor technology can't be used on an UPS, it 
destroys the UPS when it activates). And then when the power comes back 
on the UPS input line, it would have to repower, but only after the UPS 
says it is sufficiently recharged. All of this could be done, but there 
is no way in the time and money I have available, I would have to create 
an apm BIOS surrogate, sort of like an external modem, but designed to 
fill in missing BIOS functionality (I would plug an rs232 from the 
machine to the surrogate, and then another from surrogate to UPS). By 
the time I get done doing this, I might just as well get a cheap new 
case/motherboard that supports apm in BIOS to start with (though it 
would be interesting to make a surrogate that adapts rs232 UPS to 
ethernet for broadcast, removing the need for rs232 going to all of the 
machines; plus it would be fun to build if I had the money).

> Something like this http://www.qkits.com/serv/qkits/diy/pages/QK108.asp
> You might also be able to pull something off with X10, such as do an init
> 1 then use a firecracker module to have the computer shut its own power
> off.

 From other responses I know that I can tell the linux machine that 
there is power failure, and I can do things like init 0. My only 
remaining goal is to be able to cut power to the Linux box before the 
UPS goes down all of the way (in order to improve battery life, I am 
willing to cut 20 minutes of up time to 15, or 45 to 30, so on...a few 
minutes of up time is not going to help me beyond the first 5 minutes or 
so, but it would be more cost effective to have the battery survive an 
extra year). It is too bad that the hardware/motherboard/power supply 
involved is too old to work with shutting its own power down.

Come to think of it, perhaps the motherboard can do so, but it was a 
cheap mobo that is rather old; being a Pentium 166 MMX, in a case 
originally designed for a 486, perhaps the motherboard would work with 
apm, at least with some older standard (I will go check in a few 
minutes). In that case, only the case needs to be replaced (no pun 
intended). Can anyone tell me of a really inexpensive case/power supply 
(maybe 250 watts) that is somewhat reasonable quality and supports 
apm-aware motherboards? (I won't go that route if it costs too much, I'd 
just go buy a barebones system instead and add my network and video card 
and so on from the old machine)

D. Stimits, stimits AT idcomm.com

More information about the LUG mailing list