Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

TUTORIAL: APC UPS management with apcupsd

by Andrew Newman (CREATED: 2004-03-09; Last Modified 2004-12-21)

In this tutorial you will learn how to install and manage the apcupsd daemon to control your computer in the event of a power outage. This assumes that you have a recent APC Uninterruptable Power Supply (UPS) for your system. My experience here is with the APC Back-UPS RS 1500 but should serve as a guide for other APC set-ups as well.

If you have a Belkin UPS this link may be of some help.

Also, I have created an addendum to this tutorial if you are using an older APC UPS with a 'dumb' connection (ADDED: 2004-03-14).

There is also a brief HOWTO on using NUT to monitor your UPS here.

NOTE for Fedora Core 2 & 3: I have not tried this, but have been told it works. You will need to create the USB devices since the 2.6 kernel doesn't see them automatically. To do this run, as root:

% /etc/apcupsd/make-hiddev
% cp -rp /dev/usb /etc/udev/devices
See: fedoraforum.org/forum/showthread.php?t=29168 for more information on using with FC 2&3.



Getting Started (Installation):

Be sure that the dag repositories are in your apt-get list. See the apt howto for more information.
Once the dag repositories are seen by apt just run the following:

% apt-get install apcupsd
 Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  apcupsd
0 upgraded, 1 newly installed, 0 removed and 24 not upgraded.
Need to get 2797kB of archives.
After unpacking 5129kB of additional disk space will be used.
Get:1 http://apt.sw.be redhat/fc1/en/i386/dag apcupsd 3.10.11-1.rhfc1.dag [2797kB]
Fetched 2797kB in 23s (117kB/s)
Committing changes...
Preparing...                ########################################### [100%]
   1:apcupsd                ########################################### [100%]
Done.

If you are not using apt, then just download the latest fc1 package from http://dag.wieers.com/packages/apcupsd/ (here I use apcupsd-3.10.11-1.rhfc1.dag.i386.rpm).
Alternatively, you can download the appropriate rpm from the official sourceforge repository, choosing between the USB and STD rpms for FC1.
Then run:

% rpm -ivh  apcupsd-3.10.11-1.rhfc1.dag.i386.rpm
Preparing...                ########################################### [100%]
   1:apcupsd                ########################################### [100%]

apcupsd should now be successfully installed on your fedora box. A simple check, that will also let you know which run-levels it is on is to type the following ls command:

% ls /etc/r*/*apcupsd
/etc/rc0.d/K99apcupsd  /etc/rc3.d/S20apcupsd  /etc/rc6.d/K99apcupsd
/etc/rc1.d/K99apcupsd  /etc/rc4.d/S20apcupsd
/etc/rc2.d/S20apcupsd  /etc/rc5.d/S20apcupsd 

This shows that it is set to startup in runlevels 2-5 and shutdown in 0, 1 and 6. This is correct.

Next: Attaching the UPS