Misc:
-
UPS HOWTO Information on using a UPS power supply with Linux.
-
UPS FAQ  The HOWTO has some other links to a UPS FAQ - possibly in text format.
-
The UPS Directory  Manufacturers and other info.
-
Ask Slashdot: Help me choose a UPS
-
Ask Slashdot: UPSs
-
Note that SW that uses SysVinit's init program may not work when the computer is in single-user mode.
See the man pages of init and inittab.
-
RS-232 Conventions (not universally accepted):
-
Logical 0/1 = TTL ~0/~5 VDC = RS-232 +12/-12, (+3..+15)/(-15..-3), HI/LO, space/mark, break/idle,
start/stop bit, 0/1 bit ( = high/low = set/cleared = up/down = raised/dropped )
(Some of these seem wrong; see the next item.)
-
The ones before the parenthesized ones are quite standard. The parenthesized ones, AFAIK, are ambiguous
unless it is clear that RS-232 levels (actual pin/wire voltages) are being discussed and not logic or
TTL levels. Many authors will switch context mid-sentence, making sense to only to themselves.
Many will just state things wrong. One must be wary of this even when a convention is clearly stated.
-
The standard C code (ioctl stuff anyway) can be confusing because its "set & clear" refer not to
logic levels, but to RS-232 line levels as above.
-
Note that an open or grounded (0 VDC) input pin on a serial port reads logical 0. This probably
violates the standard but it apparently works OK and is a widely accepted convention.
-
Note that the "idle" between RS-232 characters is supposed to be logical 1 (-15..-3 VDC).
A way to reduce the risk of disk corruption after a power failure:
This is about the dreaded "power yoyo" and how to prepare for it.
The standard discussion of UPS usage has your computer shutting down the OS, except that instead of exiting,
it shuts down the UPS so that when the mains power is restored, the computer will reboot the OS. This has
its advantages; it would restart daemons for starting timed tasks, responding to network
requests, etc. But it brings a risk: Because after a power failure one typically gives the users some time
to log out and gives the OS some time to flush buffers and shut down, the battery might be nearly "empty" by
the time it is shut down. Now if the power then comes on just long enough for the OS to get running and
then fails again, the battery may not have enough "juice" left to complete another clean shutdown. There are
other bad scenarios which involve short bursts of mains power and the extra current drawn during computer
startup.
The easiest way to avoid these risks is this: Just set up the LILO boot loader so that it waits forever for
entry of the kernel name or alias instead of automatically booting. (This setup could be done while the OS
is shutting itself down after a power failure, but that accepts the risk that the lilo command will fail.)
There are undoubtably other ways to handle it. One improvement would be to patch the LILO bootup code or
the kernel or maybe even just a startup script (before it becomes risky to loose power, whenever THAT is)
so that the bootup would stop and wait after a power failure (as noted by a file) until the power supply has
been indicating mains power has been applied for some number of hours, to ensure a mostly charged battery.
Another scheme would consider how much time the battery has been used (or even used and charged and when)
in making the decision of whether to allow the OS to complete the bootup. But it's a whole lot easier to
just stop during bootup and let a human make the decision if you don't require automation.
Another way to reduce the risk of disk corruption after a power failure:
It is often possible to rig up the UPS cable (or the serial port connector) so that an accidental (or other)
disconnection of the cable can be detected by appropriate failure detection software for warning purposes
or to assume the worst and shut down the computer. It might also be rigged so that a disconnection simply
looks (to the UPS SW) like a power failure. Consideration must be given to disconnection at either end of
the cable. The rigging is done by appropriate cable wiring and placement of pullup resisters, transistors, etc.
Software (also see particular UPS below):
-
See the HOWTO above for more info. I'm just wheting your appetite here, in most cases. Note that
many of these have info that could be used
-
Sunsite's UPS software (FTP dir)
-
upscheck - A test program that allows the serial port pins to be configured and monitored. Code in the HOWTO.
-
gentest - A small test program that allows the DTR & RTS lines to be set or cleared and changes in the
DCD, DSR, CTS, and RI lines to be monitored. Easily hacked. Part of the genpower tarball.
-
setserialbits - A small test program that allows the DTR & RTS lines to be set or cleared and changes in the
DCD, DSR, and CTS lines to be monitored. Easily hacked. Part of the powerd-2.0 tarball.
-
backupsd - Simple PD daemon to catch UPS signals. Code is in the HOWTO.
-
dumbupsd - Monitors dumb UPS and invokes a script and logs events. Plus 3 handy progs for startup scripts.
All with man pages. Does not use SysVinit's init program. Clever design with some reasons not to use init.
SuperLinux choice (with mods) for his system.
-
genpower - "Highly [and most easily] configurable"; auto-shutdown, low-bat, UPS shutdown. For dumb UPSes or
smart UPSs playing dumb. One program with man page. Nice docs. Dated Jul'95. Recommended when using init.
-
powerd-2.0 - Replacement for SysVinit's powerd. Network-aware. One prog with man page and reasonable Makefile.
Fairly configurable from a config file. No Low-battery handling. No UPS shutdown built in, but it can be
hacked using scripts and a provided program. Author recommends "genpower" for single-computer use as it
is easier and better documented. Dated Sep'95
-
upsd - Signals init. Has low-batt, UPS-shutdown. Network-aware. Single program. Reasonable Makefile. Man page.
-
usvd - Monitors line-fail, line-back, low-batt. Doesn't use SysVinit's init prog. One doc file; no man page.
UPS signal convention assumptions are described. Two small source files plus simple scripts.
Particular UPSes:
-
Note: I've only listed SW that works only with the particular UPS. There is generic SW for the others.
-
APC - American Power Conversion Corp.:
-
APC Corp.  The HOWTO says they won't disclose the protocol for communicating
with their "smart" UPSes. (Unlike Bestpower, some others.)
-
apcd - 'daemon for communication with APC SmartUPS in the "smart" mode'; Dated Aug'95. "v. Beta 0.5";
Reasonable Makefile. Most doc. is in the small man page. X11-style licence.
-
apcupsd  Some free usage. Binary only. For most, if not all, APC UPSes. Supports many APC std cables.
Lots of poorly organized and duplicative reading material. Hard to set up if you haven't done it before.
-
Bestpower (Fortress):
-
Exide:
-
Exide Electronics UPSes and "UPS and Power Management Software" (with Linux versions)
-
Deltec Power's SW site  LanSafe III; sells Linux version. May work with other dumb UPSes.
-
Powerware  The UK division of Exide Electronics, with LanSafe UPS management SW for Linux.
-
Fenton UPS ($ UPS, free SW at ftp site)
-
Merlin Gerin (Pulsar):
-
MGE home page  Someone on /. said "MGE Pulsar ES 2+" has Linux SW at its web page.
-
mgeupsd - "Program to interact with battery backups"; lsm entry says Public Domain, code says copyrighted.
-
Powerbox:
-
upsd - A simple program with very little documentation, but its simplicity might recommend it.
-
Tripplite:
-
smartups - Replacement for powerd plus X11 monitoring SW for smart UPSes. Network-aware.
A usenet article on the Fortress UPS:
Someone wrote:
>I'm just about ready to buy the Fortress 720VA . . . but I was
>interested in hearing more about their software.
I bought a Fortress 1420VA about 2 months ago and have been very
pleased with it. I bought it based on what I read in the Linux
UPS-HOWTO. Best Power is very open about their serial protocol (and
will send free docs on request) and is quite willing to help with
questions. This seems to contrast markedly with certain other UPS
manufacturers.
>Can anyone tell me about the software they provide?
>Are there any GUI tools? If so, are there any screen shots available
>anywhere?
No, it is basically a UNIX-style daemon that runs by itself in the
background. It talks to the UPS, broadcasting messages about power
failures and shutting the machine down if necessary. However, you
have source so if you are a programmer you can basically change it any
way you want. Incidentally, it does have a good many command line
switches to modify its behavior without resorting to changing the
actual code.
Personally, I added some code which logs UPS status info to files.
Then wrote some scripts which convert these logs into graphs using
gnuplot. The interface fairly primitive at this point, but it does
exactly what I want. Not the kind of GUI stuff you're thinking of
though, I'm sure.
>I can't find a damn thing on Best Power's site about the software, other
>than the fact that it exists . . .
For the tarfile, etc. see:
http://www.bestpower.com/software/unix.html
>Any help would be appreciated. Thanks.
No problem. My Fortress has worked perfectly so far. Not counting
the self tests it performs every two weeks, the inverter has come on
twice since I got it -- likely preventing my machine from rebooting in
each case. I have always suspected that the unexpected reboots I
occasionally saw were because of power problems rather than hardware
or kernel related.
Last Modified 01-Mar-1999
End of page.