APC UPS control system manual Sbin/apcupsd $ whereis apcupsd

Models: UPS control system

1 233
Download 233 pages 42.59 Kb
Page 35
Image 35

/sbin/apcupsd

$ whereis apcupsd

apcupsd: /sbin/apcupsd /etc/apcupsd /etc/apcupsd.conf /etc/apcupsd.status /usr/man/man8/apcupsd.8.gz /usr/man/man8/apcupsd.8

If you find an apcupsd in /usr/sbin, /usr/local/sbin, /usr/lib, or another such directory, it is probably a piece of an old version of apcupsd that you can delete. If you are in doubt, delete it, then rerun the make install to ensure that you haven’t deleted anything needed by the new apcupsd. Please note that the files specified above assume the default installation locations.

As a final check that the make install went well, you should check your halt script (in /etc/rc.d on SUSE systems, and in /etc/rc.d/init.d on Red Hat systems) to see that the appropriate lines have been inserted in the correct place. Modification of the halt script is important so that at the end of the shutdown procedure, apcupsd will be called again to command the UPS to turn off the power. This should only be done in a power failure situation as indicated by the presence of the /etc/powerfail file, and is necessary if you want your machine to automatically be restarted when the power returns. On a Red Hat system, the lines containing the # ***apcupsd*** should be inserted just before the final halt command:

# Remount read only anything that’s left mounted.

 

#echo "Remounting remaining filesystems (if any) readonly"

 

mount

awk ’/ext2/ { print $3 }’ while read line; do

 

mount -n -o ro,remount $line

 

done

 

 

# See if this is a powerfail situation.

# ***apcupsd***

if [ -f

/etc/apcupsd/powerfail ]; then

# ***apcupsd***

echo

 

# ***apcupsd***

echo

"APCUPSD will now power off the UPS"

# ***apcupsd***

echo

 

# ***apcupsd***

/etc/apcupsd/apccontrol killpower

# ***apcupsd***

echo

 

# ***apcupsd***

echo

"Please ensure that the UPS has powered off before rebooting" # ***apcupsd***

echo

"Otherwise, the UPS may cut the power during the reboot!!!"

# ***apcupsd***

echo

 

# ***apcupsd***

fi

 

# ***apcupsd***

#Now halt or reboot. echo "$message"

if [ -f /fastboot ]; then

echo "On the next boot fsck will be skipped." elif [ -f /forcefsck ]; then

echo "On the next boot fsck will be forced." fi

34

Page 35
Image 35
APC UPS control system manual Sbin/apcupsd $ whereis apcupsd