SuperLinux Encyclopedia - Uninterruptable Power Supplies and Software


Misc:

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):

Particular UPSes:

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.