Gentoo Archives: gentoo-commits

From: "Ian Delaney (idella4)" <idella4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-firewall/fwknop/files: fwknopd.service fwknopd.confd fwknopd.init
Date: Wed, 29 Jul 2015 11:42:00
Message-Id: 20150729114153.09144113@oystercatcher.gentoo.org
1 idella4 15/07/29 11:41:53
2
3 Modified: fwknopd.confd fwknopd.init
4 Added: fwknopd.service
5 Log:
6 revbump; new script files added to equip for systemd, other script files edited from patches via bug #554690, remove defunct fwknop-2.6.6.ebuild to avoid any mixing of updated scripts
7
8 (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)
9
10 Revision Changes Path
11 1.4 net-firewall/fwknop/files/fwknopd.confd
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.confd?rev=1.4&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.confd?rev=1.4&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.confd?r1=1.3&r2=1.4
16
17 Index: fwknopd.confd
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-firewall/fwknop/files/fwknopd.confd,v
20 retrieving revision 1.3
21 retrieving revision 1.4
22 diff -u -r1.3 -r1.4
23 --- fwknopd.confd 1 May 2015 09:55:00 -0000 1.3
24 +++ fwknopd.confd 29 Jul 2015 11:41:52 -0000 1.4
25 @@ -1,14 +1,14 @@
26 # /etc/conf.d/fwknopd: config file for /etc/init.d/fwknopd
27
28 -# Path to the fwknopd config files
29 +# Path to the fwknopd config directory (needs to be an absolute path).
30
31 FWKNOPD_CONFDIR="/etc/fwknop"
32
33
34 -# Options to pass to fwknopd daemon.
35 +# Additional options to pass to fwknopd.
36 # Refer to the fwknopd(8) manpage for more information.
37
38 -FWKNOPD_OPTS=""
39 +#FWKNOPD_OPTS=""
40
41
42 # Pid file to use (needs to be an absolute path).
43
44
45
46 1.5 net-firewall/fwknop/files/fwknopd.init
47
48 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.init?rev=1.5&view=markup
49 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.init?rev=1.5&content-type=text/plain
50 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.init?r1=1.4&r2=1.5
51
52 Index: fwknopd.init
53 ===================================================================
54 RCS file: /var/cvsroot/gentoo-x86/net-firewall/fwknop/files/fwknopd.init,v
55 retrieving revision 1.4
56 retrieving revision 1.5
57 diff -u -r1.4 -r1.5
58 --- fwknopd.init 1 May 2015 09:55:00 -0000 1.4
59 +++ fwknopd.init 29 Jul 2015 11:41:52 -0000 1.5
60 @@ -1,28 +1,27 @@
61 #!/sbin/runscript
62 # Copyright 1999-2015 Gentoo Foundation
63 # Distributed under the terms of the GNU General Public License v2
64 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/fwknop/files/fwknopd.init,v 1.4 2015/05/01 09:55:00 idella4 Exp $
65 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/fwknop/files/fwknopd.init,v 1.5 2015/07/29 11:41:52 idella4 Exp $
66
67 extra_commands="checkconfig"
68 extra_started_commands="reload"
69
70 +: ${FWKNOPD_BINARY:=/usr/sbin/fwknopd}
71 : ${FWKNOPD_CONFDIR:=/etc/fwknop}
72 : ${FWKNOPD_CONFIG:=${FWKNOPD_CONFDIR}/fwknopd.conf}
73 : ${FWKNOPD_PIDFILE:=/run/fwknop/${SVCNAME}.pid}
74 -: ${FWKNOPD_BINARY:=/usr/sbin/fwknopd}
75
76 depend() {
77 - need iptables
78 + after iptables ip6tables ebtables firewall
79 use logger
80 if [ "${rc_need+set}" = "set" ]; then
81 : # Do nothing, the user has explicitly set rc_need
82 else
83 - warn_intf=''
84 + local x warn_intf
85 for x in $(awk '/^PCAP_INTF/{ sub(";$", ""); print $2 }' "${FWKNOPD_CONFIG}" 2>/dev/null); do
86 - warn_intf="${warn_intf} $x"
87 + warn_intf="${warn_intf} ${x}"
88 done
89 - unset x
90 - if [ "${warn_intf:+set}" = "set" ]; then
91 + if [ -n "${warn_intf}" ]; then
92 need net
93 ewarn "You are binding an interface in PCAP_INTF statement in your fwknopd.conf!"
94 ewarn "You must add rc_need=\"net.FOO\" to your /etc/conf.d/${SVCNAME},"
95 @@ -30,14 +29,13 @@
96 ewarn "${warn_intf}"
97 else
98 # if PCAP_INTF and PCAP_FILE are not set, then fwknopd uses eth0
99 - if [ -z "$(grep '^PCAP_FILE' ${FWKNOPD_CONFIG})" ]; then
100 + if ! grep -q '^PCAP_FILE' "${FWKNOPD_CONFIG}"; then
101 need net
102 ewarn "You are not binding any interface in PCAP_INTF statement in your fwknopd.conf,"
103 ewarn "neither you are providing PCAP_FILE option. Thus fwknopd will listen on eth0."
104 ewarn "You must add rc_need=\"net.eth0\" to your /etc/conf.d/${SVCNAME}."
105 fi
106 fi
107 - unset warn_intf
108 fi
109 }
110
111 @@ -70,7 +68,7 @@
112
113 ebegin "Starting ${SVCNAME}"
114 start-stop-daemon --start \
115 - --exec "${FWKNOPD_BINARY}" --pidfile="${FWKNOPD_PIDFILE}" \
116 + --exec ${FWKNOPD_BINARY} --pidfile ${FWKNOPD_PIDFILE} \
117 -- ${FWKNOPD_OPTS}
118 eend $?
119 }
120 @@ -81,16 +79,14 @@
121 fi
122
123 ebegin "Stopping ${SVCNAME}"
124 - start-stop-daemon --stop \
125 - --exec "${FWKNOPD_BINARY}" --pidfile "${FWKNOPD_PIDFILE}"
126 + start-stop-daemon --stop --pidfile ${FWKNOPD_PIDFILE}
127 eend $?
128 }
129
130 reload() {
131 checkconfig || return 1
132
133 - ebegin "Reloading ${SVCNAME}"
134 - start-stop-daemon --signal HUP \
135 - --exec "${FWKNOPD_BINARY}" --pidfile "${FWKNOPD_PIDFILE}"
136 + ebegin "Reloading ${SVCNAME} configuration"
137 + start-stop-daemon --signal HUP --pidfile ${FWKNOPD_PIDFILE}
138 eend $?
139 }
140
141
142
143 1.1 net-firewall/fwknop/files/fwknopd.service
144
145 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.service?rev=1.1&view=markup
146 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-firewall/fwknop/files/fwknopd.service?rev=1.1&content-type=text/plain
147
148 Index: fwknopd.service
149 ===================================================================
150 [Unit]
151 Description=Firewall Knock Operator Daemon
152 After=network-online.target
153
154 [Service]
155 Type=forking
156 PIDFile=/run/fwknop/fwknopd.pid
157 ExecStart=/usr/sbin/fwknopd
158 ExecReload=/bin/kill -HUP $MAINPID
159
160 [Install]
161 WantedBy=multi-user.target