Previous Next Table of Contents

5. Operation

smupsd works as follows:

The Smart-UPS is polled for its current status every 10 seconds.

The battery charge level is logged 1) at startup; 2) whenever it reaches 100%; and 3) whenever it changes by 10% or more from the last value logged.

When the Smart-UPS switches to battery power, it must remain on battery for 30 seconds for smupsd to declare a power failure. This is so transient switches to battery (such as power flickers and self-tests) are ignored.

When smupsd determines that the power has failed, it logs the fact and continues to monitor the battery power level at 10 second intervals.

If at any time during a power failure the power returns, smupds will again wait for 30 seconds of samples which indicate that the Smart-UPS is no longer on battery power before logging the restoration of power.

While the UPS is on battery, if the battery power level drops below a set threshold (default: 40%) or the number of minutes specified with the -m flag have elapsed (default: no limit), smupsd notifies the init process of the loss of power.

With the default /etc/inittab provided with Red Hat Linux this will cause a system shutdown to be scheduled for 2 minutes from now. All users on the system will be notified of the impending shutdown.

If power returns, smupsd will notify init, which will cancel the shutdown, if it hasn't already started.

After 2 minutes, the system will begin an orderly shutdown. One of the last processes terminated will be smupsd itself. When smupsd receives a SIGTERM after requesting a system shutdown, it will instruct the Smart-UPS to power down after a predefined delay (by default 20 seconds) (unless smupsd was started with the -p flag).

Therefore, shortly after system shutdown is complete, the Smart-UPS will power off. It should come back on again after the power is restored. Whether or not your system comes back on at this point is system-dependent.


Previous Next Table of Contents