[TriLUG] UPS (was linksys stuff)

Aaron S. Joyner aaron at joyner.ws
Wed Jul 28 13:55:46 EDT 2004


Michael Hrivnak wrote:

>On the note of using a UPS...
>
>I want to get a UPS connected to my mandrake server at home, but there's a 
>dillema.  I want to know how you folks handle this.
>
>As it stands, the power goes out, server goes down.  Power comes on, server 
>comes back on.  For the record, this is a Celeron 500 system.
>
>Add a UPS into the mix, and I guess I would want it to wait a minute or two in 
>case power comes back, then tell the server to shutdown safely.  But, then 
>what happens when the power comes back on?  I'd be happy to wire the power 
>switch on the computer to the UPS, but is that possible/reasonable?  I don't 
>want the power to come on while the server stays off until someone gets 
>around to turning it back on.
>
>How should I handle this?
>
>Thanks!
>
>Michael
>
>  
>
Investigate both apcupsd (if you have an APC UPS) and NUT (Network UPS 
Tool, supports APC and others).  Both have the ability (although not 
fool-proof) to do what you describe.  If you can accept a reasonably 
small margin of error, or if your UPS has the ability to be turned off 
via serial or USB (and come back on when the power comes back on) you 
can accomplish your goals.

The ideal end result goes something like this.  Power turns off, battery 
gets low, computer shuts down, with its last dying breath, it instructs 
the UPS to turn itself off - which of course kills power to the computer 
as well.  The power is restored at some future date - the UPS powers up 
automatically, the computer powers up automatically.  Life is good.

The small margin of error enters if your computer is unable to actively 
turn off the UPS (for various possible reasons).  If that's the case, 
the best you can do is approximate how long a shutdown takes, instruct 
the computer to try to stay up as long as possible on battery and 
initiate a shutdown with only the required amount of battery-time 
remaining (plus a marginal grace period, of course).  Do not send the 
appropriate ACPI signals to power down the machine.  This will cause the 
machine to safely shut down, and then remain on, thus depleting the 
battery and turning off the UPS.  The UPS then comes back on when the 
power comes back on, and the machine with it.  Of course, the obvious 
danger is if the power comes back right after you finish your shutdown, 
before the UPS has given up and turned off due to lack of juice.  Then 
your box is sitting there, turned off, and unhappy.  Such is the dangers 
inherent in that setup.

Aaron J.



More information about the TriLUG mailing list