diff options
-rw-r--r-- | sys-power/apcupsd/ChangeLog | 9 | ||||
-rw-r--r-- | sys-power/apcupsd/Manifest | 17 | ||||
-rw-r--r-- | sys-power/apcupsd/apcupsd-3.14.10-r3.ebuild | 137 | ||||
-rw-r--r-- | sys-power/apcupsd/files/apcupsd.conf | 329 | ||||
-rwxr-xr-x | sys-power/apcupsd/files/apcupsd.init.4 | 49 |
5 files changed, 535 insertions, 6 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog index c4ad1fd49fc2..840f1d71d77d 100644 --- a/sys-power/apcupsd/ChangeLog +++ b/sys-power/apcupsd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-power/apcupsd # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.84 2013/09/28 10:13:42 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.85 2013/10/15 09:50:20 mattm Exp $ + +*apcupsd-3.14.10-r3 (15 Oct 2013) + + 15 Oct 2013; Matthew Marlowe <mattm@gentoo.org> +apcupsd-3.14.10-r3.ebuild, + +files/apcupsd.conf, +files/apcupsd.init.4: + First in several revisions to the apcupsd ebuild, finally starting to get it + back in shape - non keyworded during testing. *apcupsd-3.14.8-r2 (28 Sep 2013) diff --git a/sys-power/apcupsd/Manifest b/sys-power/apcupsd/Manifest index 0c36d507314a..5a2d2c4acfb5 100644 --- a/sys-power/apcupsd/Manifest +++ b/sys-power/apcupsd/Manifest @@ -4,22 +4,29 @@ Hash: SHA256 AUX apcupsd-3.14.9-aliasing.patch 2108 SHA256 21343f4798121a828a89eee49ca9fe7574b2fb45a5aad35fbfd5aabec7740761 SHA512 48eb51385136216d1cdddb6b237b89a52c516b223aa7fe50fb35761cd595d9ab7f7fabbd0e4f8c0f7d45df6feed0a2e240d227181f3d772fc5fa9f8bfa62529f WHIRLPOOL 8ad5540b942919c7ce0c3b560feb1dc6a0771b81999f546d62b8c480ecb3731994a930c72dde9c5e36d9024d4c1b97b8bd00d8baa98ee99f273c59e43070ae38 AUX apcupsd-tmpfiles.conf 39 SHA256 b00cd1a31de70a172698d486583aa79113b99c1bb4b882ab906d0e37504d7f55 SHA512 1030992a19558e79a9dddef88b508f9d9aa352223b1031f80751b2ee04821d53a185fe89cd20a7e6677709ac29179accd220a5489488b808b1280dcb2682b578 WHIRLPOOL e34d8064df32f7666e4860b49430b2434b0afb5ee7260d200329373e80a4e81416cee5616aec7ebae7005faac59060d9050fb419f4c75c2bf13024a72b445b32 AUX apcupsd-udev.rules 328 SHA256 0865097a99b321301ec5b0bb51d0560a01df0a21cca0ee0df61f8d33f888b86a SHA512 ba2ebb9f28011548c845a81f17a328b98ec8d79c1e6be33aeab863d77b9d3aa61b4dfbd1bb89a0cae00465387dffe8cc223634a6e9a2f59170846d4bed9e7135 WHIRLPOOL ec304d772bcbcd5ba3cec1437a097d6159ad1f8b8e2bde49125d6cb1970bbc6f1de6264ba35a719431aed83f88210a583bb20fab0b771c115aaa93bf1db8c867 +AUX apcupsd.conf 12481 SHA256 2caf66f43439a48d57c4ca0efe3bb1a1f14d8ce0f395bb7f90c65b74313cada9 SHA512 19f9838de025022170ac965aab1532c17aa3eb89a88f83c330ffa33ca34c2fa0eaae007dc3d55c308717af7920e7665df9571bf43ee028d557eebf5a6d393837 WHIRLPOOL 4d1df5b9f8d47d93539240f9f8231b9fbd862014faaea3ae5cd726e61744d9786e5c42bc518df1342b24d8e129c4abc68e731baedc740ccc58e6852560399c93 AUX apcupsd.init.2a 844 SHA256 86be1bafb0cf72db61def444361c659e5c36d0e44b1a007772b3f49aa0e95bcb SHA512 e86dfc3b7b8a0dbca59225795a5e996176b9a064720f4c2f6c1efc27cdf2eb0ecbdb59180b24abde1af730b834303fdf31564ec3b86a46d29ebe19abfdd48494 WHIRLPOOL e7d1e8dcb61862061d1889436c9157d95ed6a86a60aca54a0dda2120f3f5410fb700c0d889841b2013808faa349f90033a34e53eecd407df4089c58fea551f56 AUX apcupsd.init.3 659 SHA256 c3186646f06666ebd1ef265f5f6d56aeff27587face610d5f73c625b5c6053cc SHA512 fdaf68b4191dd04616c81035f8cfeafccb400a55273675b4125e67d28c3d23dc08446805e6553c868abf474773ce3a1fb36acbfbad9b85e4b6a57b7a170e01b2 WHIRLPOOL 0ea76a163c008f01d0bf8aa09219cce3a4ba6ada9f88d70b660dc06815227df37fdc82eb1b6987ec76a2cafc4f9cafa842d4ad9d81d017ef1c6d450efb077bc8 +AUX apcupsd.init.4 1041 SHA256 edc8a80bd1ccbc30f968dbf428989d81adb2d41f069593087c16fa9cfb50e59d SHA512 97cee74846a904fa1c7ac0d59862a7a61ad03d25c46fdeaf1f0bb8f226e9b7395acce33f9833695892f2c7f1387aead285ef9a4eb933de40064cf96c43e24452 WHIRLPOOL 6e709106a6acadd7637eefbea84c0c5d0f64d1763473e267d4f5bfeda16db87c635a4f3326636569aa08124fcb460388d771866412b39b552dcdff19f1d918d9 AUX apcupsd.powerfail.init 520 SHA256 eee773aa07175674085cb0ab7ed2c071fcc04fc05383d368f38d056e7327ff35 SHA512 d946d9b3427e0269d87aba1d6048cc4c73d767b1f5bc7d112718b82ec60076123e302dc0a73a4e5bbb7d1137ff78fc87a61983622a765341cfd7a79dcd0817ad WHIRLPOOL 1639496c976c6b654c20b953d675916636e44e7e3097696850bd202c91a9ffb713b398a86a2777b93472bccd3179aa83fb63ce43a1bbbe47e99f320ba8282a9c AUX apcupsd.service 111 SHA256 fef0b088daa7d652b8c30e6105318cff547ad2504627efabd014083eabc7182d SHA512 011e3e52e7909f36fb73b6064277a69e5db41263cfc72bda07e326172396d5318cd2b050f1fb84c4cc6da7a247c0035c36c55322ffb234a1cfa7bf13ba492889 WHIRLPOOL 940b6eb812c010f32b4bf54fd3e1b8d0a47890fd88acd8451bccbf6d17ab894915b179c110dda561c120e346ed20ca481f47761b9a5bac1e3b323457fbbc6f5a DIST apcupsd-3.14.10.tar.gz 1336852 SHA256 0707b5ec9916fbde9e44eb8d18037c8d8f75dfd6aeef51aba5487e189eef2032 SHA512 f95918bff783cb60fa40b03a532ee7447293b0542f44f2f9ecf36ee028df3aa414f01e2b834a28fc319d88ec2e84c81314cd546b5628554176f2ca47fdc66bbc WHIRLPOOL 1fb40a5199eb8dfcd287bab08c2bbf51f02a3657ba615e16395d5f377bc9a5b6144db24b83ef5e9172ff970a715f87f685118a035c00372c34702984fac02d38 DIST apcupsd-3.14.8.tar.gz 1317601 SHA256 8e7f2574d3abaf6637da3e790860c3f9ba64fab1ec7e50bb080de4439441c5a7 SHA512 07e6a15538bf1824b5063a1a93f33231639cf962e658c0dada1b244f2554af81824825d807ea81fd0388e25ed8fac0957621bfded96e3faeb7b594548fc4d418 WHIRLPOOL e5a580afc4955a373f020cb6e4ccbf07f9f020d4c15eaae59b416499c25a00b9d4bbc6af012bd2529024e8a3668a1d7c47f19f1bcb99f5ba60dc0108fa13c4f2 EBUILD apcupsd-3.14.10-r1.ebuild 4060 SHA256 8bd603ca14f6e42a573559d8588354240f74a4eff4b4cab7d62f460320e06fd8 SHA512 6b37efe12be278bce4b6bf7a17c88641bfe13c8304c383112a3309fca33609ca9d02ede3b6c23ed325064878da6e4c8f441ad39e92e68d791fd6348c228f0ca3 WHIRLPOOL 470e178eff2d7e1dcdc19e1860396dd9ca494f10d6e15ab60a9635b763b0f60192a883bec5a5c60ccc00fc3f48aa0035117804384d03d17b8e1cc23be949d579 EBUILD apcupsd-3.14.10-r2.ebuild 4177 SHA256 3ee47fde9a2f7be55208b2f2bbe88fe1cdf57c21783486195e7a904d476bf680 SHA512 af68e532b23719323a88e61e222eb48b5502d022d6d1ea21d56352edbe5cfeeb844b483d77c451940b6eb01c713bcc206b4365369bda7082794cdc327b2e3d0e WHIRLPOOL 54c92f7dffea8841af85867173c36cd361732a0e4ef90f3020c5e2ed7a8078eb2e1157441c2510b234cb7fdb04ee4b36b29dfb296d9227ebe8aa1bc968015599 +EBUILD apcupsd-3.14.10-r3.ebuild 4027 SHA256 7910890087593582abb052a8f92d3bcc900b1b1fff1da13cfcf0fc75d2c72e61 SHA512 71abbf7148bca5d0fa9cda5553636e6041a50cb6f8361c246fbc487f0f07b7fcfa0e2197560f8162392a57ac6f86fe8254dbda982370ee80e8f0840486f120ec WHIRLPOOL 37fc380f86218161e8a638a023b12cd2f998a5764986d27421bc44f4a1117f7969ebee736246cca3a81888d28df3a58145dec44bc2547ccdfcb216ae7ea095da EBUILD apcupsd-3.14.8-r1.ebuild 3863 SHA256 f5d984daecd4a0af67bdd5c44abeea7a4f47ed6ee94623e64e89116ff77e83b5 SHA512 5abc26eb6a258f39d7b4a617e87ee00a51c23aaeff76edd9fbc5a7b898552c5e1a270acd941d7e4d5818184d807e986da0593c239f6945c8d652867966197220 WHIRLPOOL 6ef00f538fdd0da2ac2639ece9e3209ba87190032c650cb003e7358e9f8e66f5255f58bacd0a59a7a16f17f2c393af4fb23eba14af403289444fc18d5b0140d4 EBUILD apcupsd-3.14.8-r2.ebuild 3972 SHA256 07518df91623ac0c1ce6de2f1cc5e152d890b0ac31b6ee20349b887d6456a272 SHA512 25b703ac0626173e8b8b933b6142d594acd24939fa08df58483c62b084dd57230240ccecb853e48b1491bced1cae8e78f8b1024c2842484fe642eb47712201f4 WHIRLPOOL 899c9f698a8be7b42f21b627e0828e71d8a3a0c33c297d4189b485e51e3bb2b923a11ef929acb932d029989576056543f546f4a2e8efddb6af1157879c200795 -MISC ChangeLog 27002 SHA256 b110393c806f42452a7724b37055e328ea37b4924294aceebb7ce4bef8794f25 SHA512 91efedfe711f50fc75a24c6bd0a39ebcabdfed2726c4b1841a5512f1ba35ec249df661e8cd6648b520b7ce9e1de1160332dea18347ffacbd964169989fab1c17 WHIRLPOOL 699c5e8c6feb91effd6226f7d716e6f228dc10b8641692a0112dad548696f1051f8d2f4c4cd0389eca8ca8ae6e846c646f4c2ed19dc06873938b5ac1f64379d8 +MISC ChangeLog 27289 SHA256 0f2b082d7ca2ac947b4da03c88b9abb4b1e74e0652b42d969ead06ff73558950 SHA512 d247176c6136bb03364006a774d9808755608449991bf86909e47934904f193233792f3f9a2a9425b6d0d002182fd089e87fb2dccd1d20c42ebd74e226f448c8 WHIRLPOOL 8fad971366804e0ae4e25e47dce7f9266180c892afba45f32738d1eb652f51293105f782d17d9596fda8ce633ed86ae7b02c844d1a1373f9925f66c28cba1ec8 MISC metadata.xml 854 SHA256 ed821e0f70dad05d8ec1475d40654bb39a4d4ce0e9afb3901282dd05a3662cc5 SHA512 b3d9dbbb217711502dc36e1aca3c6efb18eb31a1f375241ed12a5e1312e19fd74e3659bb9bab3afd9eeff41de7f643a367a406bab09a1bce9d7f41b5e28da988 WHIRLPOOL 7ed63a7e8f4560fccc24d664e6d43c0a9b726b7c41cb1504753869633611968d3d4d29403b07dd0c17e40c8e368b01450d36cf44215906843ff70d505bd0fb7c -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.20 (GNU/Linux) +Version: GnuPG v2.0.19 (GNU/Linux) -iEYEAREIAAYFAlJGq9cACgkQCaWpQKGI+9TxMACdHiJD5PN+ryt4HZ1+QpTdQZ9w -si0An0oltHxU9ks4Z67p5Wu3abNhO5sl -=HrQs +iQEcBAEBCAAGBQJSXQ/sAAoJEC1LWXx4YDenmQIIAKWlZQd58uGiPfOOqLUAIYjq +p0I6BuWsnwAiGHuy2q1Vpebu0YPxR6+m9uOOtxV4rkGsJqtyx1N6+racjIs8Q5Lp +/I0xXBsTsGHXKcLNpPMaZTEQzdAcKAFC0JBwuQKIXhnS90BcDRjp28QjSPslZnkz +5OOQwYfzspujsSRFdyeFQ98SjNXupQnGEJGVi+brWB018Q3wD36WsvlW3vq8cceG +WWrh4MJqMWaHqFUezzyl9NB/lHhp6Ty5Au6F9JF1rQxl1Y34uS5+JydYVjQJowWR +NQ8kd8brBJKoU+AX5m3NSMerBA/+445+7NgRX8KLPzja9mc/VV/YoCbSnptwwpQ= +=y+EA -----END PGP SIGNATURE----- diff --git a/sys-power/apcupsd/apcupsd-3.14.10-r3.ebuild b/sys-power/apcupsd/apcupsd-3.14.10-r3.ebuild new file mode 100644 index 000000000000..a4fc6a97b2cb --- /dev/null +++ b/sys-power/apcupsd/apcupsd-3.14.10-r3.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r3.ebuild,v 1.1 2013/10/15 09:50:20 mattm Exp $ + +EAPI=4 + +inherit eutils linux-info flag-o-matic systemd udev + +DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown" +HOMEPAGE="http://www.apcupsd.org/" +SRC_URI="mirror://sourceforge/apcupsd/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="snmp +usb cgi nls gnome kernel_linux systemd" + +DEPEND=" + cgi? ( >=media-libs/gd-1.8.4 ) + nls? ( sys-devel/gettext ) + snmp? ( net-analyzer/net-snmp ) + gnome? ( >=x11-libs/gtk+-2.4.0:2 + dev-libs/glib:2 + >=gnome-base/gconf-2.0 )" +RDEPEND="${DEPEND} + sys-apps/openrc + virtual/mailx" + +CONFIG_CHECK="~USB_HIDDEV ~HIDRAW" +ERROR_USB_HIDDEV="CONFIG_USB_HIDDEV: needed to access USB-attached UPSes" +ERROR_HIDRAW="CONFIG_HIDRAW: needed to access USB-attached UPSes" + +pkg_setup() { + if use kernel_linux && use usb && linux_config_exists; then + check_extra_config + fi +} + +src_prepare() { + epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch" +} + +src_configure() { + local myconf + use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=/usr/libexec/${PN}/cgi-bin" + if use usb; then + myconf="${myconf} --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= " + else + myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart --disable-usb" + fi + + # We force the DISTNAME to gentoo so it will use gentoo's layout also + # when installed on non-linux systems. + econf \ + --sbindir=/sbin \ + --sysconfdir=/etc/apcupsd \ + --with-pwrfail-dir=/etc/apcupsd \ + --with-lock-dir=/var/run/apcupsd \ + --with-pid-dir=/var/run/apcupsd \ + --with-log-dir=/var/log \ + --with-nis-port=3551 \ + --enable-net --enable-pcnet \ + --with-distname=gentoo \ + $(use_enable snmp net-snmp) \ + $(use_enable gnome gapcmon) \ + ${myconf} \ + APCUPSD_MAIL=/bin/mail +} + +src_compile() { + # Workaround for bug #280674; upstream should really just provide + # the text files in the distribution, but I wouldn't count on them + # doing that anytime soon. + MANPAGER=$(type -p cat) \ + emake || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "installed failed" + rm -f "${D}"/etc/init.d/halt + + insinto /etc/apcupsd + newins examples/safe.apccontrol safe.apccontrol + doins "${FILESDIR}"/apcupsd.conf + + dodoc ChangeLog* ReleaseNotes + doman doc/*.8 doc/*.5 + + dohtml -r doc/manual/* + + rm "${D}"/etc/init.d/apcupsd + newinitd "${FILESDIR}/${PN}.init.4" "${PN}" + newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail + + if use systemd; then + systemd_dounit "${FILESDIR}"/${PN}.service + systemd_dotmpfilesd "${FILESDIR}"/${PN}-tmpfiles.conf + fi + + # remove hal settings, we don't really want to have it around still. + rm -r "${D}"/usr/share/hal + + # replace it with our udev rules if we're in Linux + if use kernel_linux; then + udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules + fi + +} + +pkg_postinst() { + if use cgi; then + elog "The cgi-bin directory for ${PN} is /usr/libexec/${PN}/cgi-bin." + elog "Set up your ScriptAlias or symbolic links accordingly." + fi + + elog "" + elog "Since version 3.14.0 you can use multiple apcupsd instances to" + elog "control more than one UPS in a single box with openRC." + elog "To do this, create a link between /etc/init.d/apcupsd to a new" + elog "/etc/init.d/apcupsd.something, and it will then load the" + elog "configuration file at /etc/apcupsd/something.conf." + elog "" + + elog 'If you want apcupsd to power off your UPS when it' + elog 'shuts down your system in a power failure, you must' + elog 'add apcupsd.powerfail to your shutdown runlevel:' + elog '' + elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m' + elog '' + + if use kernel_linux; then + elog "Starting from version 3.14.9-r1, ${PN} installs udev rules" + elog "for persistent device naming. If you have multiple UPS" + elog "connected to the machine, you can point them to the devices" + elog "in /dev/apcups/by-id directory." + fi +} diff --git a/sys-power/apcupsd/files/apcupsd.conf b/sys-power/apcupsd/files/apcupsd.conf new file mode 100644 index 000000000000..27e311cab70e --- /dev/null +++ b/sys-power/apcupsd/files/apcupsd.conf @@ -0,0 +1,329 @@ +## apcupsd.conf v1.1 ## +# +# for apcupsd release 3.14.10 (13 September 2011) - gentoo +# +# "apcupsd" POSIX config file + +# +# ========= General configuration parameters ============ +# + +# UPSNAME xxx +# Use this to give your UPS a name in log files and such. This +# is particulary useful if you have multiple UPSes. This does not +# set the EEPROM. It should be 8 characters or less. +#UPSNAME + +# UPSCABLE <cable> +# Defines the type of cable connecting the UPS to your computer. +# +# Possible generic choices for <cable> are: +# simple, smart, ether, usb +# +# Or a specific cable model number may be used: +# 940-0119A, 940-0127A, 940-0128A, 940-0020B, +# 940-0020C, 940-0023A, 940-0024B, 940-0024C, +# 940-1524C, 940-0024G, 940-0095A, 940-0095B, +# 940-0095C, M-04-02-2000 +# +UPSCABLE usb + +# To get apcupsd to work, in addition to defining the cable +# above, you must also define a UPSTYPE, which corresponds to +# the type of UPS you have (see the Description for more details). +# You must also specify a DEVICE, sometimes referred to as a port. +# For USB UPSes, please leave the DEVICE directive blank. For +# other UPS types, you must specify an appropriate port or address. +# +# UPSTYPE DEVICE Description +# apcsmart /dev/tty** Newer serial character device, appropriate for +# SmartUPS models using a serial cable (not USB). +# +# usb <BLANK> Most new UPSes are USB. A blank DEVICE +# setting enables autodetection, which is +# the best choice for most installations. +# +# net hostname:port Network link to a master apcupsd through apcupsd's +# Network Information Server. This is used if the +# UPS powering your computer is connected to a +# different computer for monitoring. +# +# snmp hostname:port:vendor:community +# SNMP network link to an SNMP-enabled UPS device. +# Hostname is the ip address or hostname of the UPS +# on the network. Vendor can be can be "APC" or +# "APC_NOTRAP". "APC_NOTRAP" will disable SNMP trap +# catching; you usually want "APC". Port is usually +# 161. Community is usually "private". +# +# netsnmp hostname:port:vendor:community +# OBSOLETE +# Same as SNMP above but requires use of the +# net-snmp library. Unless you have a specific need +# for this old driver, you should use 'snmp' instead. +# +# dumb /dev/tty** Old serial character device for use with +# simple-signaling UPSes. +# +# pcnet ipaddr:username:passphrase:port +# PowerChute Network Shutdown protocol which can be +# used as an alternative to SNMP with the AP9617 +# family of smart slot cards. ipaddr is the IP +# address of the UPS management card. username and +# passphrase are the credentials for which the card +# has been configured. port is the port number on +# which to listen for messages from the UPS, normally +# 3052. If this parameter is empty or missing, the +# default of 3052 will be used. +# +UPSTYPE usb +DEVICE + +# POLLTIME <int> +# Interval (in seconds) at which apcupsd polls the UPS for status. This +# setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb, +# dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting +# will improve apcupsd's responsiveness to certain events at the cost of +# higher CPU utilization. The default of 60 is appropriate for most +# situations. +POLLTIME 30 + +# LOCKFILE <path to lockfile> +# Path for device lock file. Not used on Win32. +LOCKFILE /var/run/apcupsd + +# SCRIPTDIR <path to script directory> +# Directory in which apccontrol and event scripts are located. +SCRIPTDIR /etc/apcupsd + +# PWRFAILDIR <path to powerfail directory> +# Directory in which to write the powerfail flag file. This file +# is created when apcupsd initiates a system shutdown and is +# checked in the OS halt scripts to determine if a killpower +# (turning off UPS output power) is required. +PWRFAILDIR /etc/apcupsd + +# NOLOGINDIR <path to nologin directory> +# Directory in which to write the nologin file. The existence +# of this flag file tells the OS to disallow new logins. +NOLOGINDIR /etc + + +# +# ======== Configuration parameters used during power failures ========== +# + +# The ONBATTERYDELAY is the time in seconds from when a power failure +# is detected until we react to it with an onbattery event. +# +# This means that, apccontrol will be called with the powerout argument +# immediately when a power failure is detected. However, the +# onbattery argument is passed to apccontrol only after the +# ONBATTERYDELAY time. If you don't want to be annoyed by short +# powerfailures, make sure that apccontrol powerout does nothing +# i.e. comment out the wall. +ONBATTERYDELAY 10 + +# +# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so +# the first that occurs will cause the initation of a shutdown. +# + +# If during a power failure, the remaining battery percentage +# (as reported by the UPS) is below or equal to BATTERYLEVEL, +# apcupsd will initiate a system shutdown. +BATTERYLEVEL 0 + +# If during a power failure, the remaining runtime in minutes +# (as calculated internally by the UPS) is below or equal to MINUTES, +# apcupsd, will initiate a system shutdown. +MINUTES 0 + +# If during a power failure, the UPS has run on batteries for TIMEOUT +# many seconds or longer, apcupsd will initiate a system shutdown. +# A value of 0 disables this timer. +# +# Note, 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. Of course, +# if you are testing, setting this to 60 causes a quick system shutdown +# if you pull the power plug. +# 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. +TIMEOUT 0 + +# Time in seconds between annoying users to signoff prior to +# system shutdown. 0 disables. +ANNOY 45 + +# Initial delay after power failure before warning users to get +# off the system. +ANNOYDELAY 90 + +# The condition which determines when users are prevented from +# logging in during a power failure. +# NOLOGON <string> [ disable | timeout | percent | minutes | always ] +NOLOGON disable + +# If KILLDELAY is non-zero, apcupsd will continue running after a +# shutdown has been requested, and after the specified time in +# seconds attempt to kill the power. This is for use on systems +# where apcupsd cannot regain control after a shutdown. +# KILLDELAY <seconds> 0 disables +KILLDELAY 0 + +# +# ==== Configuration statements for Network Information Server ==== +# + +# NETSERVER [ on | off ] on enables, off disables the network +# information server. If netstatus is on, a network information +# server process will be started for serving the STATUS and +# EVENT data over the network (used by CGI programs). +NETSERVER on + +# NISIP <dotted notation ip address> +# IP address on which NIS server will listen for incoming connections. +# This is useful if your server is multi-homed (has more than one +# network interface and IP address). Default value is 0.0.0.0 which +# means any incoming request will be serviced. Alternatively, you can +# configure this setting to any specific IP address of your server and +# NIS will listen for connections only on that interface. Use the +# loopback address (127.0.0.1) to accept connections only from the +# local machine. +NISIP 127.0.0.1 + +# NISPORT <port> default is 3551 as registered with the IANA +# port to use for sending STATUS and EVENTS data over the network. +# It is not used unless NETSERVER is on. If you change this port, +# you will need to change the corresponding value in the cgi directory +# and rebuild the cgi programs. +NISPORT 3551 + +# If you want the last few EVENTS to be available over the network +# by the network information server, you must define an EVENTSFILE. +EVENTSFILE /var/log/apcupsd.events + +# EVENTSFILEMAX <kilobytes> +# By default, the size of the EVENTSFILE will be not be allowed to exceed +# 10 kilobytes. When the file grows beyond this limit, older EVENTS will +# be removed from the beginning of the file (first in first out). The +# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set +# to zero to allow the EVENTSFILE to grow without limit. +EVENTSFILEMAX 25 + +# +# ========== Configuration statements used if sharing ============= +# a UPS with more than one machine + +# +# Remaining items are for ShareUPS (APC expansion card) ONLY +# + +# UPSCLASS [ standalone | shareslave | sharemaster ] +# Normally standalone unless you share an UPS using an APC ShareUPS +# card. +UPSCLASS standalone + +# UPSMODE [ disable | share ] +# Normally disable unless you share an UPS using an APC ShareUPS card. +UPSMODE disable + +# +# ===== Configuration statements to control apcupsd system logging ======== +# + +# Time interval in seconds between writing the STATUS file; 0 disables +STATTIME 0 + +# Location of STATUS file (written to only if STATTIME is non-zero) +STATFILE /var/log/apcupsd.status + +# LOGSTATS [ on | off ] on enables, off disables +# Note! This generates a lot of output, so if +# you turn this on, be sure that the +# file defined in syslog.conf for LOG_NOTICE is a named pipe. +# You probably do not want this on. +LOGSTATS off + +# Time interval in seconds between writing the DATA records to +# the log file. 0 disables. +DATATIME 0 + +# FACILITY defines the logging facility (class) for logging to syslog. +# If not specified, it defaults to "daemon". This is useful +# if you want to separate the data logged by apcupsd from other +# programs. +#FACILITY DAEMON + +# +# ========== Configuration statements used in updating the UPS EPROM ========= +# + +# +# These statements are used only by apctest when choosing "Set EEPROM with conf +# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD. +# + +# UPS name, max 8 characters +#UPSNAME UPS_IDEN + +# Battery date - 8 characters +#BATTDATE mm/dd/yy + +# Sensitivity to line voltage quality (H cause faster transfer to batteries) +# SENSITIVITY H M L (default = H) +#SENSITIVITY H + +# UPS delay after power return (seconds) +# WAKEUP 000 060 180 300 (default = 0) +#WAKEUP 60 + +# UPS Grace period after request to power off (seconds) +# SLEEP 020 180 300 600 (default = 20) +#SLEEP 180 + +# Low line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 106 103 100 097 +# M 177 172 168 182 +# A 092 090 088 086 +# I 208 204 200 196 (default = 0 => not valid) +#LOTRANSFER 208 + +# High line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 127 130 133 136 +# M 229 234 239 224 +# A 108 110 112 114 +# I 253 257 261 265 (default = 0 => not valid) +#HITRANSFER 253 + +# Battery charge needed to restore power +# RETURNCHARGE 00 15 50 90 (default = 15) +#RETURNCHARGE 15 + +# Alarm delay +# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never +# BEEPSTATE 0 T L N (default = 0) +#BEEPSTATE T + +# Low battery warning delay in minutes +# LOWBATT 02 05 07 10 (default = 02) +#LOWBATT 2 + +# UPS Output voltage when running on batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 115 +# M 208 +# A 100 +# I 230 240 220 225 (default = 0 => not valid) +#OUTPUTVOLTS 230 + +# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on +# SELFTEST 336 168 ON OFF (default = 336) +#SELFTEST 336 diff --git a/sys-power/apcupsd/files/apcupsd.init.4 b/sys-power/apcupsd/files/apcupsd.init.4 new file mode 100755 index 000000000000..6777a7884d4c --- /dev/null +++ b/sys-power/apcupsd/files/apcupsd.init.4 @@ -0,0 +1,49 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.4,v 1.1 2013/10/15 09:50:19 mattm Exp $ + +INSTANCE="${SVCNAME#*.}" +if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "apcupsd" ]; then + INSTANCE="apcupsd" +fi + +dir="/var/run/apcupsd" + +depend() { + use net +} + +start_pre() { + checkpath -d -m 0775 -o root:uucp ${dir} +} + +start() { + rm -f /etc/apcupsd/powerfail + + export SERVICE="${SVCNAME}" + + if [ ! -d "${dir}" ]; then + einfo " Creating ${dir}" + /bin/mkdir -p "${dir}" + /bin/chown root:uucp "${dir}" + fi + + ebegin "Starting APC UPS daemon" + start-stop-daemon \ + --start --pidfile "${dir}/${SVCNAME}.pid" \ + --exec /sbin/apcupsd -- \ + -f "/etc/apcupsd/${INSTANCE}.conf" \ + -P "${dir}/${SVCNAME}.pid" + eend $? +} + +stop() { + ebegin "Stopping APC UPS daemon" + start-stop-daemon \ + --stop --pidfile "${dir}/${SVCNAME}.pid" \ + --retry TERM/5/TERM/5 \ + --exec /sbin/apcupsd + eend $? +} + |