Gentoo Archives: gentoo-commits

From: "Bjarke Istrup Pedersen (gurligebis)" <gurligebis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-wireless/hostapd/files: hostapd-init.d
Date: Fri, 21 Mar 2014 19:47:17
Message-Id: 20140321194714.D2A342004F@flycatcher.gentoo.org
1 gurligebis 14/03/21 19:47:14
2
3 Modified: hostapd-init.d
4 Log:
5 Improving init.d script and moved from /var/run to /run, fixing bug #505166
6
7 (Portage version: 2.2.8-r1/cvs/Linux i686, signed Manifest commit with key 15AE484C)
8
9 Revision Changes Path
10 1.4 net-wireless/hostapd/files/hostapd-init.d
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d?rev=1.4&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d?rev=1.4&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d?r1=1.3&r2=1.4
15
16 Index: hostapd-init.d
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d,v
19 retrieving revision 1.3
20 retrieving revision 1.4
21 diff -u -r1.3 -r1.4
22 --- hostapd-init.d 25 Sep 2011 14:03:46 -0000 1.3
23 +++ hostapd-init.d 21 Mar 2014 19:47:14 -0000 1.4
24 @@ -1,7 +1,11 @@
25 #!/sbin/runscript
26 -# Copyright 1999-2011 Gentoo Foundation
27 +# Copyright 1999-2014 Gentoo Foundation
28 # Distributed under the terms of the GNU General Public License v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d,v 1.3 2011/09/25 14:03:46 gurligebis Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d,v 1.4 2014/03/21 19:47:14 gurligebis Exp $
31 +
32 +pidfile="/run/${SVCNAME}.pid"
33 +command="/usr/sbin/hostapd"
34 +command_args="-P ${pidfile} -B ${OPTIONS} ${CONFIGS}"
35
36 extra_started_commands="reload"
37
38 @@ -15,7 +19,7 @@
39 use logger
40 }
41
42 -checkconfig() {
43 +start_pre() {
44 local file
45
46 for file in ${CONFIGS}; do
47 @@ -26,25 +30,10 @@
48 done
49 }
50
51 -start() {
52 - checkconfig || return 1
53 -
54 - ebegin "Starting ${SVCNAME}"
55 - start-stop-daemon --start --exec /usr/sbin/hostapd \
56 - -- -B ${OPTIONS} ${CONFIGS}
57 - eend $?
58 -}
59 -
60 -stop() {
61 - ebegin "Stopping ${SVCNAME}"
62 - start-stop-daemon --stop --exec /usr/sbin/hostapd
63 - eend $?
64 -}
65 -
66 reload() {
67 - checkconfig || return 1
68 + start_pre || return 1
69
70 ebegin "Reloading ${SVCNAME} configuration"
71 - kill -HUP $(pidof /usr/sbin/hostapd) > /dev/null 2>&1
72 + kill -HUP $(cat ${pidfile}) > /dev/null 2>&1
73 eend $?
74 }