-
Notifications
You must be signed in to change notification settings - Fork 0
/
apcupsd-3.14.10-unmenu-package-x86_64.conf
60 lines (56 loc) · 5.43 KB
/
apcupsd-3.14.10-unmenu-package-x86_64.conf
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#UNMENU_RELEASE $Revision$ $Date$
PACKAGE_NAME <b>apcupsd</b> - APC UPS Daemon
PACKAGE_DESCR Apcupsd can be used for power mangement and controlling most of APC's
PACKAGE_DESCR UPS models on Unix and Windows machines. Apcupsd works with most of
PACKAGE_DESCR APC's Smart-UPS models as well as most simple signalling models such
PACKAGE_DESCR as Back-UPS, and BackUPS-Office.
PACKAGE_DESCR During a power failure, apcupsd will inform the users about the power
PACKAGE_DESCR failure and that a shutdown may occur. If power is not restored, a
PACKAGE_DESCR system shutdown will follow when the battery is exhausted, a timeout
PACKAGE_DESCR (seconds) expires, or runtime expires based on internal APC
PACKAGE_DESCR calculations determined by power consumption rates.
PACKAGE_DESCR
PACKAGE_DESCR <br><ul><li>You must have installed and configured a "mail" command on your unRAID server to receive ups related e-mail notices.</li>
PACKAGE_DESCR <li>Make sure you have your router/switch connected to an UPS as well, otherwise the e-mail notices that apcupsd generates may not be sent as your unRAID box wouldn't be able to reach the internet.</li>
PACKAGE_DESCR <b><font color=blue>You must also install the "Clean Powerdown" package for this program to be able to shut the unRAID server down cleanly.<br>
PACKAGE_DESCR This package, Mail and the 'Clean Powerdown' package should all be set to re-install on reboot.</font></b></ul>
PACKAGE_DESCR
PACKAGE_URL http://rlworkman.net/pkgs/14.1/x86_64/apcupsd-3.14.10-x86_64-1_rlw.txz
PACKAGE_FILE apcupsd-3.14.10-x86_64-1_rlw.txz
PACKAGE_MD5 7a30888a2706575d641fccf013994db0
PACKAGE_INSTALLED /sbin/apcaccess
PACKAGE_DEPENDENCIES /usr/bin/mail, /sbin/powerdown
PACKAGE_VARIABLE Use Serial Port?(YES/NO/network_master:port)||vDEVICE=NO||If set to NO, a connection via USB cable is used. If YES, a connection via SERIAL cable will be used. If set to anything else, that port will be used. <br>(Set to remote_master:port to network slave off another server running apcupsd. <br> Example: if the master is "tower" then set this field to </b>tower:3551</b> )
PACKAGE_VARIABLE Cable Type:(smart/usb/dumb/ether)||vCABLETYPE=smart||Use "smart" for APC UPS, "usb" for some other brands, "dumb" for others with appropriate cable to serial port, "ether" to slave off of apcupsd running on another server.
PACKAGE_VARIABLE Battery Level||vBATTERYLEVEL=5||Shutdown will occur when percentage charge remaining is less than this level.
PACKAGE_VARIABLE Minutes Remaining||vMINUTES=5||Shutdown will occur when remaining runtime reaches this value.
PACKAGE_VARIABLE Total Seconds Outage||vTIMEOUT=0||If you have a Smart UPS, you will most likely want to disable this timer by setting it to zero. That way, you UPS will continue on batteries until either the % charge remaing drops to or below BATTERYLEVEL, or the remaining battery runtime drops to or below MINUTES. If you have an older dumb UPS, you will want to set this to less than the time you know you can run on batteries.
PACKAGE_VARIABLE Power Down UPS after shutdown?(YES/NO)||vUPS_KILL=NO||If YES the UPS will power itself off after the server is powered down. This allows it to save its batteries. If NO, the UPS will not power down. You only want this if the UPS is powering other equipment that must stay powered.
# check for existing config/install
PACKAGE_INSTALLATION test -f /etc/apcupsd/apcupsd.conf && rm /etc/apcupsd/apcupsd.conf
PACKAGE_INSTALLATION [ ! -d /var/lock/subsys/ ] && mkdir -p /var/lock/subsys
PACKAGE_INSTALLATION [ -f /etc/rc.d/rc.apcupsd ] && /etc/rc.d/rc.apcupsd stop
PACKAGE_INSTALLATION killall apcupsd
# install package
PACKAGE_INSTALLATION installpkg apcupsd-3.14.10-x86_64-1_rlw.txz
# update .conf with user settings
PACKAGE_INSTALLATION [ "${vDEVICE-NO}" != "YES" ] && sed -i -e "s/^DEVICE \/dev\/ttyS0/#DEVICE \/dev\/ttyS0/" /etc/apcupsd/apcupsd.conf
PACKAGE_INSTALLATION [ "${vDEVICE-NO}" = "YES" ] && sed -i -e "s/^UPSTYPE usb/UPSTYPE apcsmart/" /etc/apcupsd/apcupsd.conf
PACKAGE_INSTALLATION [ "${vCABLETYPE-smart}" != "smart" ] && sed -i -e "s/^UPSCABLE smart/UPSCABLE ${vCABLETYPE-smart}/" /etc/apcupsd/apcupsd.conf
PACKAGE_INSTALLATION sed -i -e "s/^MINUTES 3/MINUTES ${vMINUTES-5}/" /etc/apcupsd/apcupsd.conf
PACKAGE_INSTALLATION sed -i -e "s/^BATTERYLEVEL 5/BATTERYLEVEL ${vBATTERYLEVEL-5}/" /etc/apcupsd/apcupsd.conf
PACKAGE_INSTALLATION sed -i -e "s/^TIMEOUT 0/TIMEOUT ${vTIMEOUT-0}/" /etc/apcupsd/apcupsd.conf
# hack in delay on restart service (prevent the log rotation process from killing the daemon because the pid wasnt removed quick enough)
PACKAGE_INSTALLATION sed -i -e "s/\$0 stop/\$0 stop\n sleep 3/" /etc/rc.d/rc.apcupsd
PACKAGE_INSTALLATION /etc/rc.d/rc.apcupsd start
# copy clean powerdown script as the apcupsd doshutdown script
PACKAGE_INSTALLATION [ ! -f /sbin/powerdown ] && echo "<font color=red><b>You must ALSO install the 'Clean Powerdown' package. The server will not shut down cleanly without it.</b></font>"
PACKAGE_INSTALLATION echo "/sbin/powerdown" >/etc/apcupsd/doshutdown
PACKAGE_INSTALLATION echo "exit 99" >>/etc/apcupsd/doshutdown
PACKAGE_INSTALLATION chmod 755 /etc/apcupsd/doshutdown
# handle 'power down ups after shutdown'
PACKAGE_INSTALLATION [ "${vUPS_KILL-NO}" = "YES" ] && sed -i -e "s/\/sbin\/poweroff/\/etc\/apcupsd\/apccontrol killpower; \/sbin\/poweroff/" /etc/rc.d/rc.6
PACKAGE_VERSION_TEST strings /sbin/apcupsd | grep VERSION | grep -v "^VERSION$" | awk '{ print $3 }'
PACKAGE_VERSION_STRING 3.14.10
PACKAGE_MEMORY_USAGE Light (10K to 500K)
PACKAGE_OS 64bit