[lug] apm/UPS

John Karns jkarns at csd.net
Sun Aug 4 13:40:02 MDT 2002


On Fri, 2 Aug 2002, D. Stimits said:

> 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.

I've been using several APC Back-UPS units at different sites and one
Smart-UPS.  There are one or two UPS how-to docs which explain how to set
it up.  I think that APC may now be supplying a Linux daemon with the
units, but the supplied cable is for the other OS.  According to papers
included with the last units purchased, APC will supply a cable tailored
to the Linux daemon free of charge upon request.  I've been making my own
cables.  All it takes are the connectors, a 5 conductor cable, and a 10k
Ohm resistor.  The daemon will do a shutdown after a specified period of
time.  Then in the final shutdown script, the server's serial port sends a
signal to the UPS to turn off the inverter which prevents full discharge
of the battery, cutting power to all devices.  This scheme works well with
both the AT and ATX style PS's, provided that the ATX PS machine BIOS can
be set to resume in powered up state following a cut of the power.

I once tried a different, slightly cheaper brand of UPS, but strongly
regretted it, as the inverter would not reliably shutdown - sometimes
would but others not.  Some of the UPS units come with a schematic and
information on how to control the inverter, so that you can adapt a cable
to work.

I've been told that Triplite is now supporting Linux as well.  For quite
some time they were not doing so, and guarded the pin-out info for their
serial port as if it were a national treasure, refusing to answer any
questions about it.

I've been using the same daemon (genpowerd) for about three years.  There
may be better choices now, such as upsd; I haven't looked too closely.  I
chose the genpowerd because the docs explained the cable layout and the
machine configuration.

----------------------------------------------------------------
John Karns                                        jkarns at csd.net





More information about the LUG mailing list