1 |
flameeyes 11/08/29 13:38:55 |
2 |
|
3 |
Added: apcupsd.init.2a |
4 |
Log: |
5 |
Avoid depending on OpenRC for the old versions, .9 will be the one openrc-only, the older ones will have to work with baselayout 1 as well, for people not updating right now. |
6 |
|
7 |
(Portage version: 2.2.0_alpha51/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-power/apcupsd/files/apcupsd.init.2a |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.2a?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.2a?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: apcupsd.init.2a |
16 |
=================================================================== |
17 |
#!/sbin/runscript |
18 |
# Copyright 1999-2011 Gentoo Foundation |
19 |
# Distributed under the terms of the GNU General Public License v2 |
20 |
# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.2a,v 1.1 2011/08/29 13:38:55 flameeyes Exp $ |
21 |
|
22 |
INSTANCE="${SVCNAME#*.}" |
23 |
if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "apcupsd" ]; then |
24 |
INSTANCE="apcupsd" |
25 |
fi |
26 |
|
27 |
depend() { |
28 |
use net |
29 |
} |
30 |
|
31 |
start() { |
32 |
rm -f /etc/apcupsd/powerfail |
33 |
|
34 |
export SERVICE="${SVCNAME}" |
35 |
|
36 |
ebegin "Starting APC UPS daemon" |
37 |
start-stop-daemon \ |
38 |
--start --pidfile "/var/run/${SVCNAME}.pid" \ |
39 |
--exec /sbin/apcupsd -- \ |
40 |
-f "/etc/apcupsd/${INSTANCE}.conf" \ |
41 |
-P "/var/run/${SVCNAME}.pid" |
42 |
eend $? |
43 |
} |
44 |
|
45 |
stop() { |
46 |
ebegin "Stopping APC UPS daemon" |
47 |
start-stop-daemon \ |
48 |
--stop --pidfile "/var/run/${SVCNAME}.pid" \ |
49 |
--retry TERM/5/TERM/5 \ |
50 |
--exec /sbin/apcupsd |
51 |
eend $? |
52 |
} |