next up previous contents index
Next: Configuration Examples Up: Apcupsd User's Guide Previous: Building and Installing apcupsd   Contents   Index

Subsections


After Installation


Checking Your Configuration File

Once you have installed apcupsd, either from a binary package or by building from source, your next step should be to inspect your /etc/apcupsd/apcupsd.conf file to make sure it is valid.

You can read the complete reference on configuration directives (see Configuration Directive Reference), but if you are setting up a normal standalone configuration you should only need to check (and possibly fix) the first three items listed below.

Your UPSTYPE should be the UPS's protocol type: dumb, apcsmart, usb, net, snmp, or ether. Your UPSCABLE should be the type of cable you are using. You should have gotten both from the table of types (see type_table); usually they will both be the string ``usb''.

If you have a USB device, it is better not to specify a DEVICE directive by commenting it out. Apcupsd will automatically search for your device in the standard places. If you specify a DEVICE, it should be the name of the device (or device range) that apcupsd is to use to communicate with the UPS. If you're using a USB UPS under Linux, you may leave the device name field blank and apcupsd will search all the standard locations for the UPS. You may also explicitly specify the device location as either /dev/usb/hid/hiddev[0-15] (on non-Red-Hat systems) or /dev/usb/hiddev[0-15] (on Red Hat systems), but this is not recommended.

Note that you should enter ``/dev/usb/hiddev[0-15]'' literally as shown. The ``[0-15]'' expression tells apcupsd to search all hiddev devices until it finds a UPS. You can restrict the search to a subset of devices by using something like ``[0-4]'', but keep in mind this will limit apcupsd's ability to locate the UPS if the kernel relocates it to a different device node, which happens occasionally during short power failures. Again, it is highly recommended to leave the DEVICE directive blank and let apcupsd find your device automatically.

If the first time you execute apcupsd, you get a message to the effect that the Apcupsd USB driver is missing, it means that you most likely forgot to put --enable-usb on your ./configure command line. If you loaded apcupsd from an rpm file, you may have selected the wrong one -- please ensure that the word usb appears in the rpm package name.

The next chapter (see Configuration Examples) of this manual provides you with the essential characteristics of each main type of configuration file. After those elements are correct, apcupsd should run, and then it is only a matter of customization of your setup.


Arranging for Reboot on Power-Up

The final consideration for a automatic reboot after a full power down is to ensure that your computer will automatically reboot when the power is restored.

This is not the normal behavior of most computers as shipped from the factory. Normally after the power is cut and restored, you must explicitly press a button for the power to actually be turned on. You can test your computer by powering it down; shutting off the power (pull the plug); then plugging the cord back in. If your computer immediately starts up, good. There is nothing more to do.

If your computer does not start up, manually turn on the power (by pressing the power on button) and enter your computer's SETUP program (often by pressing DEL during the power up sequence; sometimes by pressing F10). You must then find and change the appropriate configuration parameter to permit instant power on.

Normally, this is located under the BOOT menu item, and will be called something such as Restore on AC/Power Loss or Full-On. The exact words will vary according to the ROM BIOS provider. Generally you will have three options: Last State, Power On, and Power Off. Although Last State should normally work, we recommend setting your computers to Power On. This means that whenever the power is applied they are on. The only way to shut them off is to pull the plug or to have a special program that powers them off (/sbin/poweroff on Linux systems).

If after making all the changes suggested above, you cannot get your computer to automatically reboot, you might examine your halt script (/etc/rc.d/init.d/halt in the case of Red Hat Linux) and see if the final line that performs the halt or reboot contains the -p option for powering down the computer. It should not with the logic used by apcupsd, but if it does, the -p option could cause your computer to power off while the UPS is still suppling power (i.e. before the UPS kills the power). Depending on the setting of your BIOS, it may prevent your computer from restarting when the power returns. As already mentioned, this should not apply, but in case of problems it is worth a try.


Making sure apcupsd Is Running

The simplest way to invoke apcupsd is from the command line by entering:

     /sbin/apcupsd

To do so, you must be root. However, normally, you will want apcupsd started automatically when your system boots. On some systems with installation support (e.g. SUSE and Red Hat), the installation procedure will create a script file that you will be automatically invoked when your system reboots. On other systems, you will have to invoke apcupsd from your rc.local script.

On Red Hat systems, this script file that automatically invokes apcupsd on system start and stops is: /etc/rc.d/init.d/apcupsd

To start apcupsd manually (as you will probably do immediately following the installation), enter the following:

     /etc/rc.d/init.d/apcupsd start

To understand how this file is automatically invoked at system startup and shutdown, see the man pages for chkconfig(8).

On SUSE systems, the script file that automatically invokes apcupsd on system start and stops is /etc/rc.d/apcupsd

To start apcupsd manually (as you will probably do immediately following the installation), enter the following:

     /etc/rc.d/apcupsd start

Normally, when properly installed, apcupsd will be started and stopped automatically by your system. Unfortunately, the details are different for each system. Below, we give the commands for selected systems. Alternatively, there are simple stopapcupsd and startapcupsd scripts in the examples directory, or you can modify one of the scripts in the distributions directory to meet your needs.

To stop apcupsd you can do the following:

On Red Hat systems:

     /etc/rc.d/init.d/apcupsd stop

On SUSE systems:

     /etc/rc.d/apcupsd stop

Please see the Testing Apcupsd (see Testing Apcupsd) chapter for more details on insuring that apcupsd is running properly.


next up previous contents index
Next: Configuration Examples Up: Apcupsd User's Guide Previous: Building and Installing apcupsd   Contents   Index
2009-03-11