diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-26 13:56:44 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-26 13:56:44 +0000 |
commit | 891dd883d12e1b22e0abb8a0163fc08584203159 (patch) | |
tree | 3bf4ccb1ca1de24e0348e00ef4ef48512e8d94ea /main/apcupsd/apcupsd.initd | |
parent | b135457ff0ba0eda52c9808f767a2a30013cc9ac (diff) | |
download | aports-891dd883d12e1b22e0abb8a0163fc08584203159.tar.bz2 aports-891dd883d12e1b22e0abb8a0163fc08584203159.tar.xz |
main/apcupsd: moved from testing
Diffstat (limited to 'main/apcupsd/apcupsd.initd')
-rw-r--r-- | main/apcupsd/apcupsd.initd | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/main/apcupsd/apcupsd.initd b/main/apcupsd/apcupsd.initd new file mode 100644 index 0000000000..5265347f41 --- /dev/null +++ b/main/apcupsd/apcupsd.initd @@ -0,0 +1,38 @@ +#!/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 + after firewall +} + +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 $? +} + |