apcupsd

APC UPS Daemon (apcupsd) is a tool which monitors power supply equipment manufactured by APC.

You may wish to investigate the Network UPS tools (NUT) Addon instead of this one. NUT has more features and is capable of supporting UPSes from multiple manufacturers and for multiple client computers connected to one UPS. It is also more maintained than acpupsd.

Installation

To install apcupsd open the IPFire Console and type:

pakfire install -y apcupsd

… or install it via the webinterface by the use of Pakfire!

Find more information about apcupsd here.

Edit the configuration file

The configuration file will be found under:

/etc/apcupsd/apcupsd.conf

Its already created by the installer and is documented in detail.

Its important to configure the correct UPS and connection type here.

If NETServer is enabled (NETServer on) you may also check the status from other Windows or Linux machines.

Create the initscript

To create the initscript for apcupsd use an editor (like nano) and add the following:

filename = apcupsd

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Begin $rc_base/init.d/apcupsd

# Based on sysklogd script from LFS-3.1 and earlier.

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
    start)
boot_mesg "Starting apcupsd daemon..."
loadproc apcupsd
;;
    stop)
boot_mesg "Stopping apcupsd daemon..."
killproc apcupsd
;;
    status)
statusproc /sbin/apcupsd
;;
    *)
echo "Usage: $0 (start|stop|status)"
exit 1
;;
esac

# End $rc_base/init.d/apcupsd

Then change the file permission with:

chmod 755 /etc/init.d/apcupsd

start the apcups daemon with:

/etc/init.d/apcupsd start

To stop the daemon, type:

/etc/init.d/apcupsd stop

on the IPFire Console or via SSH!

Establish the autostart of apcupsd

Enable the autostart

ln -s ../init.d/apcupsd /etc/rc.d/rc3.d/S65apcupsd
ln -s ../init.d/apcupsd /etc/rc.d/rc0.d/K35apcupsd
ln -s ../init.d/apcupsd /etc/rc.d/rc6.d/K35apcupsd

Disable the autostart

rm /etc/rc.d/rc3.d/S65apcupsd
rm /etc/rc.d/rc0.d/K35apcupsd
rm /etc/rc.d/rc6.d/K35apcupsd
Edit Page ‐ Yes, you can edit!

Older Revisions • June 12 at 2:30 am • Jon