apcupsd under RHEL/CentOS

The following is a quick’n dirty HOWTO for installing apcupsd under Redhat Enterprise Linux / CentOS 4 as it is not really trivial.

  • untar the tarball
  • cd to the newly created directory apcupsd-x.y.z
  • call configure to build the appropriate Makefile for the platform
  • copy the tarball to whereever your _topdir resides, e.g. /home/user/rpm/SOURCES
  • copy the file Release\_Notes also to /home/user/rpm/SOURCES and create there a zipped tarball named Release_Notes-x.y.z-r.tar.gz (versions numbers must match those defined in apcupsd.spec)
  • call rpmbuild -ba –define “build\_rhel4 1” –define “build\_usb 1” apcupsd.spec
  • install it and adjust /etc/apcupsd.conf to your needs.

Important point: You must assure that after a system shutdown when mains power comes back, your computer starts automatically. In my case this has not happend. I had to tweak manually /etc/init.d/halt to not issue a “halt -p” (-p stands for power down). Its enough to comment out the line which extends the HALTARGS variable.