Next Previous Contents

2. Important note on obsolete information

I've just discovered that some of the documentation below is obsolete. In particular, the init daemon that comes with the latest sysvinit package is more sophisticated than I've portrayed it to be. Although it seems that the current version is backward compatible with what's written here, it looks like it has some undocumented features which are very important for UPS support.

The control mechanism outlined below only allows powerd to give init one of two messages, namely powerfail or powerok. init runs one command when it receives powerfail, and another when it receives powerok. This leads to complicated powerd logic for dealing with low battery signals and other sorts of special situations.

Newer versions of init (as of version 2.58, it seems) are more sophisticated. These versions can be signaled to run one of three scripts. Thus, init can have a powerfail script for announcing a power outage, a powerfailnow script for doing an immediate shutdown, and a powerok script for halting any pending shutdowns. This is much cleaner than the gyrations one would have to go through with the mechanisms detailed below.

Although most of the discussion here assumes the old init communication method, I just added two new sections where the authors uses the new communcation method. These are sections Trust Energy Protector 400/650 and APC Smart-UPS 700. The former is especially detailed. Both include a powerd.c which signals init to do an immediate shutdown when a low battery signal is received, as well as the relevant /etc/inittab lines to make this work. Other than this, all I can tell you is to look at the source code for init.

Also, for all I know, many of the software packages listed below also use this newer communication method.


Next Previous Contents