UbuntuHelp:Apcupsd
来自Ubuntu中文
apcupsdttp://www.apcupsd.com/, has very helpful documentation for doing complicated setups.
Prerequsites
- An APC UPS. Apcupsd works with most of APC's Smart-UPS models as well as most simple signalling models such a Back-UPS, and BackUPS-Office.
Installation
First of all, we have to install apcupsd package. Install theapcupsd
package in the Synaptic Package Manager. See UbuntuHelp:SynapticHowto. If you want to see the stat of the UPS through the browser, you can also install apcupsd-cgipackage. Edit the file
/etc/apcupsd/apcupsd.confwhich by default includes good comments on usage:
- For
UPSCABLE
you have to specify the type of cable connecting the UPS to your computer. Read the comments in the file to see which possibilities you have. For example, if the UPS used is the APC Back-UPS ES 700V, you have to writeusb
. - You must also look for and modify the
UPSTYPE
. The comments in the file describes the different possibilities available. You may choose the appropriate one. Again, from our example of an APC Back-UPS ES 700V, you would writeusb
. - The final setting you must fix is
DEVICE
. As the commenno
with ausb
type UPS apcupsd can autodetect the device, so you should comment out theDEVICE
setting (by putting a '#' in front of it). Otherwise, you will need to know which/dev
node your device is connected to. If your UPS cable is a serial type then your device may be something like/dev/ttyS0
.
/etc/default/apcupsdand change the
no
of the ISCONFIGUREDwith a
yes. Once you have apcupsd configured, running and the device connected to your computer you will be able to check on the status of the device using the
apcaccesscommand. Output from the command will vary based on the type of UPS you have. Most likely, the better the UPS the more detailed the information you will get. Optionally, if you want your computer to reboot after a power fail, you must edit the
/etc/init.d/haltdue a bug that it has. You must change the
poweroff="-p"with
poweroff=""
The following applies to Drapper Drake (LTS 6.06)[Might also apply to later releases]
You need to uncomment the line 10 in file "/etc/apcupsd/killpower" which means change:
- mount -n -o ro /usr
to mount -n -o ro /usr This will ensure that the shared libraries libcrypto.so.0.9.8, libnetsnmp.so.9, libstdc++.so.6 and libz.so.1 are visible to apcupsd after shutdown when it runs "/etc/apcupsd/apccontrol killpower" to shut off the ups power otherwise the UPS will stay on and your system will not automatically reboot when utility power returns.