summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-01-15 15:21:11 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-01-15 15:21:11 +0000
commit6a2368f85808efcc9fce7f2117dd2d89990877f3 (patch)
treea9c2d718a82d923044bf247491ba9ac0ff1e9b99 /sys-power/apcupsd/files
parentRemoved 2 obsolete patches (diff)
downloadhistorical-6a2368f85808efcc9fce7f2117dd2d89990877f3.tar.gz
historical-6a2368f85808efcc9fce7f2117dd2d89990877f3.tar.bz2
historical-6a2368f85808efcc9fce7f2117dd2d89990877f3.zip
Version bump, finally closing bug #228011 (thanks to all for the patience). Also fix bug #240694 (thanks to Billy DeVincentis for the init script), #254242 (thanks to Gordon Pritchard for reporting), #243070 (thanks to Ryan Tandy for the patch).
Package-Manager: portage-2.2_rc22/cvs/Linux 2.6.28-gentoo x86_64
Diffstat (limited to 'sys-power/apcupsd/files')
-rw-r--r--sys-power/apcupsd/files/apcupsd.init.237
1 files changed, 37 insertions, 0 deletions
diff --git a/sys-power/apcupsd/files/apcupsd.init.2 b/sys-power/apcupsd/files/apcupsd.init.2
new file mode 100644
index 000000000000..43868f75ddaf
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd.init.2
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.2,v 1.1 2009/01/15 15:21:11 flameeyes Exp $
+
+INSTANCE="${SVCNAME#*.}"
+if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "apcupsd" ]; then
+ INSTANCE="apcupsd"
+fi
+
+depend() {
+ use net
+}
+
+start() {
+ rm -f /etc/apcupsd/powerfail
+
+ export SERVICE="${SVCNAME}"
+
+ ebegin "Starting APC UPS daemon"
+ start-stop-daemon \
+ --start --pidfile "/var/run/${SVCNAME}.pid" \
+ --exec /sbin/apcupsd -- \
+ -f "/etc/apcupsd/${INSTANCE}.conf" \
+ -P "/var/run/${SVCNAME}.pid"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping APC UPS daemon"
+ start-stop-daemon \
+ --stop --pidfile "/var/run/${SVCNAME}.pid" \
+ --retry TERM/5/TERM/5 \
+ --exec /sbin/apcupsd
+ eend $?
+}
+