Prev |  | Next

## 58. My UPS (an APC as it happens) lacks the field "battery.charge.restart" — so how will it know when to restart?

You can rig up a little hack to handle this issue in software.

Essentially, you need to test for the POWERDOWNFLAG in your startup scripts while the filesystems are still read-only (before `upsmon` daemon has started and removed it). You can also query `upsmon -K` for presence of the file, to avoid hard-coding the path or parsing it from your `upsmon.conf` file. If the flag is there, you know your last shutdown was caused by a power failure and the UPS battery is probably still quite weak.

In this situation, your best bet is to sleep it off. Pausing in your startup script to let the batteries recharge with the filesystems in a safe state is recommended. This way, if the power goes out again, you won’t face a situation where there’s not enough battery capacity left for upsmon to do its thing.

Exactly how long to wait is a function of your UPS hardware, and will require careful testing.

If this is too evil for you, buy another kind of UPS that will either wait for a minimum amount of charge, a minimum amount of time, or both.

Prev |  | Next
| Home |