Apcupsd

Introduction
This guide will show you how to configure your Gentoo installation to communicate with your APC UPS. This will allow the UPS to tell the computer to shut down when the UPS is running on batteries and power runs low.

Prerequisites
There are several assumptions that this guide makes.


 * The APC UPS is connected to the computer via a USB cable. The APC UPS daemon works with a serial connection without any kernel special modifications.
 * You are using the 2.6.x kernel.
 * You are familiar with and comfortable with recompiling your kernel.

Kernel Configuration
USB support must be apart of the kernel, ideally this support should just be compiled into the kernel directly.

The mandatory requirements are: CONFIG_USB, CONFIG_USB_HID, CONFIG_USB_HIDDEV, CONFIG_USB_DEVICEFS

If the exact kernel options shown above are not available in your kernel, I have mine working (version 2.6.27) with the following kernel options are shown below.

Installing APCUPSD
Firstly you will need to make an entry to the file as follows:

In some cases that file will need to be created with the command first.

If is not in your global use flags, you will need to add this line to your package.use.

It is now time to emerge the APC UPS software:

It is important to set the service to start at boot up:

For the purposes of testing force a manual start using:

From now on the application can be tested from the shell using the command.

Configuring APCUPSD
If you using USB BackUPS:

Apcupsd