1 |
commit: ebc9f18d8d44f468e1e34fcc273c8cfed1ea006a |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 26 02:27:51 2011 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 26 02:27:51 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/blueness.git;a=commit;h=ebc9f18d |
7 |
|
8 |
net-misc/tinc: cleaned up the init scripts |
9 |
|
10 |
--- |
11 |
net-misc/tinc/ChangeLog | 4 +++ |
12 |
net-misc/tinc/Manifest | 18 +++----------- |
13 |
net-misc/tinc/files/tincd | 35 +++++++++++++++-------------- |
14 |
net-misc/tinc/files/tincd.conf | 6 ++-- |
15 |
net-misc/tinc/files/tincd.lo | 48 +++++++++++++++++++++++++--------------- |
16 |
5 files changed, 59 insertions(+), 52 deletions(-) |
17 |
|
18 |
diff --git a/net-misc/tinc/ChangeLog b/net-misc/tinc/ChangeLog |
19 |
index 1bfda10..3e06add 100644 |
20 |
--- a/net-misc/tinc/ChangeLog |
21 |
+++ b/net-misc/tinc/ChangeLog |
22 |
@@ -1,5 +1,9 @@ |
23 |
|
24 |
|
25 |
+ 26 Sep 2011; Anthony G. Basile <blueness@g.o> files/tincd, |
26 |
+ files/tincd.conf, files/tincd.lo: |
27 |
+ Cleaned up the init scripts |
28 |
+ |
29 |
26 Sep 2011; Anthony G. Basile <blueness@g.o> tinc-1.0.16-r1.ebuild, |
30 |
-files/tincdnosyslog, -files/tincdsyslog, files/tincd, files/tincd.conf: |
31 |
Changed to toggle syslog on conf.d variable, bug #371357#c11 |
32 |
|
33 |
diff --git a/net-misc/tinc/Manifest b/net-misc/tinc/Manifest |
34 |
index e74b70c..8e3d769 100644 |
35 |
--- a/net-misc/tinc/Manifest |
36 |
+++ b/net-misc/tinc/Manifest |
37 |
@@ -1,18 +1,8 @@ |
38 |
------BEGIN PGP SIGNED MESSAGE----- |
39 |
-Hash: SHA256 |
40 |
- |
41 |
AUX tinc.networks 387 RMD160 cc842d8ab6fb137d87276553fbf7465baeccf871 SHA1 8339d5882e494a0fd2390e1abfd0f24163949ce4 SHA256 7165721abd3706c95973118fbb503e18f9a008da6bdbf21a4ce35ecf7818d5ad |
42 |
-AUX tincd 1768 RMD160 63fe4752d38c5a6b4dd2e6d3183985fd159076e8 SHA1 4229d77ec8791ed5d4cd92b0a0088b5da4b61648 SHA256 0f841330fef6f27480bc71ddc950f372f447f986414f169e780b2f0c5ff889ed |
43 |
-AUX tincd.conf 140 RMD160 a8cb9f6c3076ec62c5d8b630e884ad84e77cfbec SHA1 2983aa5d70b693a00319b45d576d26519338ee53 SHA256 948aebf1d1f2b46cd4a8ac21f9983244504a291ad5b05d49583c37f8b529a43e |
44 |
-AUX tincd.lo 1174 RMD160 f3173005b3020712b6e6eae1f5d34825d5d08726 SHA1 7daea8e502a2cf0abc80c510315ee53172f39a64 SHA256 ce3e150bc3822f19754705826365238401386de1f012f8665727111e11a8b175 |
45 |
+AUX tincd 1754 RMD160 689f1b30822a101a6f3e612fa56d8ea88f93ca65 SHA1 d012405de4eedc6c2ecb454ba2d3f1939a73f2eb SHA256 ff9b51f0aedb760d25acb2de1e1814603d4168ace8ee377e69eecbecaf365716 |
46 |
+AUX tincd.conf 157 RMD160 72e67087f4f88a4958a54eb8cf8270cdfebe4339 SHA1 82dda948f1982c9289d6732f20b7e0da33ca2f6a SHA256 eef883d3cf4ba8376f6b37518f39df103b0d999c5faa2a82653926ce50255060 |
47 |
+AUX tincd.lo 1358 RMD160 ea70799c678490f9bf5729d3d97f27c05b409c7c SHA1 ec77436c4d31f737967174c3057413f41aacfd4c SHA256 dfa94c22d415bbe71ff5df838232100dfb7cbe3e6fe9578c935574cf0627d61e |
48 |
DIST tinc-1.0.16.tar.gz 519460 RMD160 a4d44bd90d4c19f4cc8bc27c1f92a8fb437698d3 SHA1 6700e63c548228b1675f243f0075f98511f1e3a8 SHA256 f20863cb1155ba4e4dd4cf16c35a5d706cd326eb8fe62b8b0a31fd57241a5400 |
49 |
EBUILD tinc-1.0.16-r1.ebuild 1000 RMD160 0752f0f125e53b32c165d662d707f459428cd49a SHA1 29b5fa860889f94d3c6ae933b7a2752e4e5440e4 SHA256 3c333ae27d401bf726afdfb6e83ae27f2840d3b6fd722c838fe8362758bd9a6b |
50 |
-MISC ChangeLog 485 RMD160 884419631b449658ab20a654a557a35fa3e2fcc3 SHA1 74b33808d3a685e582e8144ab32a70c3a06959b7 SHA256 0c484bf5f1eb8ab88457a4550f6a632dab38709d2e84ce814c72b523d850b199 |
51 |
+MISC ChangeLog 620 RMD160 fe4be2e228f773ed17d5b3d5a9cf6b42d19ebced SHA1 80db5feda129494e29bd20b2433d16713de7e20c SHA256 1145d5ff03215e993c64b0844cdb1e30144b24165f4310ca8af70f5cea7a360e |
52 |
MISC metadata.xml 323 RMD160 4afa38944097d8968b63842a67ed19531f0d9ec4 SHA1 40e3e0444e37634e1c939a5dd5677cef74827778 SHA256 8a800ba6f409642a7327882575dab780d140d7692155b5644850421abb7bb4d5 |
53 |
------BEGIN PGP SIGNATURE----- |
54 |
-Version: GnuPG v2.0.17 (GNU/Linux) |
55 |
- |
56 |
-iEYEAREIAAYFAk5/1XQACgkQl5yvQNBFVTWLOwCeMF47KzQACZAHyktRkOdR6kbg |
57 |
-6bYAn2BsygtCzGeFFRqunRnJ4pDtXpON |
58 |
-=pb4G |
59 |
------END PGP SIGNATURE----- |
60 |
|
61 |
diff --git a/net-misc/tinc/files/tincd b/net-misc/tinc/files/tincd |
62 |
index dfddf26..09f7090 100644 |
63 |
--- a/net-misc/tinc/files/tincd |
64 |
+++ b/net-misc/tinc/files/tincd |
65 |
@@ -5,7 +5,8 @@ |
66 |
|
67 |
extra_commands="reload" |
68 |
|
69 |
-TINC_NETS="/etc/conf.d/tinc.networks" |
70 |
+NETS="/etc/conf.d/tinc.networks" |
71 |
+DAEMON="/usr/sbin/tincd" |
72 |
|
73 |
depend() { |
74 |
use logger dns |
75 |
@@ -13,8 +14,8 @@ depend() { |
76 |
} |
77 |
|
78 |
checkconfig() { |
79 |
- if ! grep -q '^ *NETWORK:' "${TINC_NETS}" ; then |
80 |
- eerror "No VPN networks configured in ${TINC_NETS}" |
81 |
+ if ! grep -q '^ *NETWORK:' "${NETS}" ; then |
82 |
+ eerror "No VPN networks configured in ${NETS}" |
83 |
return 1 |
84 |
fi |
85 |
} |
86 |
@@ -22,21 +23,21 @@ checkconfig() { |
87 |
start() { |
88 |
checkconfig || return 1 |
89 |
ebegin "Starting tinc VPN networks" |
90 |
- awk '/^ *NETWORK:/ { print $2 }' "${TINC_NETS}" | while read TINCNET |
91 |
+ awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME |
92 |
do |
93 |
- CONFIG="/etc/tinc/${TINCNET}/tinc.conf" |
94 |
- PIDFILE="/var/run/tinc.${TINCNET}.pid" |
95 |
+ CONFIG="/etc/tinc/${NETNAME}/tinc.conf" |
96 |
+ PIDFILE="/var/run/tinc.${NETNAME}.pid" |
97 |
if [ ! -f "${CONFIG}" ]; then |
98 |
- eerror "Cannot start network ${TINCNET}." |
99 |
+ eerror "Cannot start network ${NETNAME}." |
100 |
eerror "Please set up ${CONFIG} !" |
101 |
else |
102 |
- ebegin "Starting tinc network ${TINCNET}" |
103 |
- if [ "${TINC_SYSLOG}" == "yes" ]; then |
104 |
- LOG=" --logfile=/var/log/tinc.${TINCNET}.log" |
105 |
+ ebegin "Starting tinc network ${NETNAME}" |
106 |
+ if [ "${SYSLOG}" == "yes" ]; then |
107 |
+ LOG=" --logfile=/var/log/tinc.${NETNAME}.log" |
108 |
else |
109 |
LOG="" |
110 |
fi |
111 |
- start-stop-daemon --start --exec /usr/sbin/tincd -- --net="${TINCNET}" "${LOG}" --pidfile "${PIDFILE}" |
112 |
+ start-stop-daemon --start --exec "${DAEMON}" -- --net="${NETNAME}" "${LOG}" --pidfile "${PIDFILE}" |
113 |
eend $? |
114 |
fi |
115 |
done |
116 |
@@ -44,11 +45,11 @@ start() { |
117 |
|
118 |
stop() { |
119 |
ebegin "Stopping tinc VPN networks" |
120 |
- awk '/^ *NETWORK:/ { print $2 }' "${TINC_NETS}" | while read TINCNET |
121 |
+ awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME |
122 |
do |
123 |
- PIDFILE="/var/run/tinc.${TINCNET}.pid" |
124 |
+ PIDFILE="/var/run/tinc.${NETNAME}.pid" |
125 |
if [ -f "${PIDFILE}" ]; then |
126 |
- ebegin "Stopping tinc network ${TINCNET}" |
127 |
+ ebegin "Stopping tinc network ${NETNAME}" |
128 |
start-stop-daemon --stop --pidfile "${PIDFILE}" |
129 |
eend $? |
130 |
fi |
131 |
@@ -57,11 +58,11 @@ stop() { |
132 |
|
133 |
reload() { |
134 |
ebegin "Reloading configuration for tinc VPN networks" |
135 |
- awk '/^ *NETWORK:/ { print $2 }' "${TINC_NETS}" | while read TINCNET |
136 |
+ awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME |
137 |
do |
138 |
- PIDFILE="/var/run/tinc.${TINCNET}.pid" |
139 |
+ PIDFILE="/var/run/tinc.${NETNAME}.pid" |
140 |
if [ -f "${PIDFILE}" ]; then |
141 |
- ebegin "Reloading tinc network ${TINCNET}" |
142 |
+ ebegin "Reloading tinc network ${NETNAME}" |
143 |
start-stop-daemon --signal HUP --pidfile ${PIDFILE} |
144 |
eend $? |
145 |
fi |
146 |
|
147 |
diff --git a/net-misc/tinc/files/tincd.conf b/net-misc/tinc/files/tincd.conf |
148 |
index 65d6907..0394702 100644 |
149 |
--- a/net-misc/tinc/files/tincd.conf |
150 |
+++ b/net-misc/tinc/files/tincd.conf |
151 |
@@ -1,5 +1,5 @@ |
152 |
#rc_need="net.net" |
153 |
|
154 |
-#If you want TINC to log to syslog, then set this to "yes" |
155 |
-#Anything else and tincd will log to FIXME |
156 |
-TINC_SYSLOG="yes" |
157 |
+#If you want tincd to log to syslog, then set this to "yes" |
158 |
+#Anything else and tincd will log to /var/log/tinc.NETNAME.log. |
159 |
+SYSLOG="yes" |
160 |
|
161 |
diff --git a/net-misc/tinc/files/tincd.lo b/net-misc/tinc/files/tincd.lo |
162 |
index 4b5dde6..2a2e864 100644 |
163 |
--- a/net-misc/tinc/files/tincd.lo |
164 |
+++ b/net-misc/tinc/files/tincd.lo |
165 |
@@ -3,7 +3,9 @@ |
166 |
# Distributed under the terms of the GNU General Public License v2 |
167 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.lo,v 1.1 2010/07/18 10:04:56 dragonheart Exp $ |
168 |
|
169 |
-opts="reload" |
170 |
+extra_commands="reload" |
171 |
+ |
172 |
+DAEMON="/usr/sbin/tincd" |
173 |
|
174 |
depend() |
175 |
{ |
176 |
@@ -13,34 +15,44 @@ depend() |
177 |
|
178 |
start() |
179 |
{ |
180 |
- TINCNET=${RC_SVCNAME#*.} |
181 |
- if [ -f /etc/tinc/"$TINCNET"/tinc.conf ] ; then |
182 |
- ebegin "Starting tinc network $TINCNET" |
183 |
- /usr/sbin/tincd --debug=1 --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid |
184 |
- eend $? |
185 |
+ NETNAME="${RC_SVCNAME#*.}" |
186 |
+ CONFIG="/etc/tinc/${NETNAME}/tinc.conf" |
187 |
+ PIDFILE="/var/run/tinc.${NETNAME}.pid" |
188 |
+ if [ ! -f "${CONFIG}" ]; then |
189 |
+ eerror "Cannot start network ${NETNAME}." |
190 |
+ eerror "Please set up ${CONFIG} !" |
191 |
else |
192 |
- eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" |
193 |
+ ebegin "Starting tinc network $NETNAME" |
194 |
+ if [ "${SYSLOG}" == "yes" ]; then |
195 |
+ LOG=" --logfile=/var/log/tinc.${NETNAME}.log" |
196 |
+ else |
197 |
+ LOG="" |
198 |
+ fi |
199 |
+ start-stop-daemon --start --exec "${DAEMON}" -- --net="${NETNAME}" "${LOG}" --pidfile "${PIDFILE}" |
200 |
+ eend $? |
201 |
fi |
202 |
} |
203 |
|
204 |
stop() |
205 |
{ |
206 |
- TINCNET=${RC_SVCNAME#*.} |
207 |
- if [ -f /var/run/tinc."$TINCNET".pid ] ; then |
208 |
- ebegin "Stopping tinc network $TINCNET" |
209 |
- /usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid |
210 |
+ NETNAME="${RC_SVCNAME#*.}" |
211 |
+ CONFIG="/etc/tinc/${NETNAME}/tinc.conf" |
212 |
+ PIDFILE="/var/run/tinc.${NETNAME}.pid" |
213 |
+ if [ -f "${PIDFILE}" ] ; then |
214 |
+ ebegin "Stopping tinc network ${NETNAME}" |
215 |
+ start-stop-daemon --stop --pidfile "${PIDFILE}" |
216 |
eend $? |
217 |
- else |
218 |
- eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" |
219 |
fi |
220 |
} |
221 |
|
222 |
reload() |
223 |
{ |
224 |
- TINCNET=${RC_SVCNAME#*.} |
225 |
- if [ -f /var/run/tinc."$TINCNET".pid ] ; then |
226 |
- ebegin "Reloading configuration for tinc network $TINCNET" |
227 |
- /usr/sbin/tincd --kill HUP --pidfile=/var/run/tinc."$TINCNET".pid |
228 |
- eend $? |
229 |
+ NETNAME=${RC_SVCNAME#*.} |
230 |
+ CONFIG="/etc/tinc/${NETNAME}/tinc.conf" |
231 |
+ PIDFILE="/var/run/tinc.${NETNAME}.pid" |
232 |
+ if [ -f "${PIDFILE}" ] ; then |
233 |
+ ebegin "Reloading tinc network ${NETNAME}" |
234 |
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}" |
235 |
+ eend $? |
236 |
fi |
237 |
} |