Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/varnish/files: varnishlog.initd varnishncsa.confd varnishd.confd-r3 varnishlog.confd varnishncsa.initd varnishd.initd-r3 varnishd.logrotate-r2
Date: Thu, 22 May 2014 20:23:52
Message-Id: 20140522202348.726E92004C@flycatcher.gentoo.org
1 idl0r 14/05/22 20:23:48
2
3 Added: varnishlog.initd varnishncsa.confd
4 varnishd.confd-r3 varnishlog.confd
5 varnishncsa.initd varnishd.initd-r3
6 varnishd.logrotate-r2
7 Log:
8 Revbump. Major changes
9
10 Logdir no longer world readable - bug 458888
11 varnishd, varnishncsa and varnishlog have been split into separate init scripts, also fixes bug 480252
12 Run Varnish as user (varnish/varnish)
13 Check the VCL for errors before stopping varnishd when doing a restart
14
15 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key B427ABC8)
16
17 Revision Changes Path
18 1.1 www-servers/varnish/files/varnishlog.initd
19
20 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.initd?rev=1.1&view=markup
21 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.initd?rev=1.1&content-type=text/plain
22
23 Index: varnishlog.initd
24 ===================================================================
25 #!/sbin/runscript
26 # Copyright 1999-2014 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 # $Header: /var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishlog.initd,v 1.1 2014/05/22 20:23:48 idl0r Exp $
29
30 VARNISHLOG_PID=${VARNISHLOG_PID:-/run/${SVCNAME}.pid}
31
32 command="${VARNISHLOG:-/usr/bin/varnishlog}"
33 command_args="-D -P ${VARNISHLOG_PID} ${VARNISHLOG_OPTS}"
34 pidfile="${VARNISHLOG_PID}"
35
36 extra_started_commands="reload rotate flush"
37
38 description_rotate="Rotate the log file"
39 description_flush="Flush any outstanding transactions"
40
41 rotate() {
42 ebegin "Rotating log file"
43 start-stop-daemon -p ${VARNISHLOG_PID} -s SIGHUP
44 eend $?
45 }
46
47 flush() {
48 ebegin "Flushing any outstanding transactions"
49 start-stop-daemon -p ${VARNISHLOG_PID} -s SIGUSR1
50 eend $?
51 }
52
53 reload() {
54 flush
55 rotate
56 }
57
58
59
60 1.1 www-servers/varnish/files/varnishncsa.confd
61
62 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.confd?rev=1.1&view=markup
63 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.confd?rev=1.1&content-type=text/plain
64
65 Index: varnishncsa.confd
66 ===================================================================
67 # /etc/conf.d/varnishncsa
68
69 VARNISHNCSA_OPTS="-a -w /var/log/varnish/${SVCNAME}.log"
70
71
72
73 1.1 www-servers/varnish/files/varnishd.confd-r3
74
75 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.confd-r3?rev=1.1&view=markup
76 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.confd-r3?rev=1.1&content-type=text/plain
77
78 Index: varnishd.confd-r3
79 ===================================================================
80 # /etc/conf.d/varnishd
81
82 VARNISHD="/usr/sbin/varnishd"
83 VARNISHADM="/usr/bin/varnishadm"
84
85 #CONFIGFILES="/etc/varnish/${SVCNAME}.vcl"
86 CONFIGFILE="/etc/varnish/default.vcl"
87
88 # Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
89 #VARNISHD_OPTS="-a 127.0.0.1:8080 -a 127.0.0.1:8080"
90
91 # Alternatively, don't listen to a backend
92 VARNISHD_OPTS="-a 127.0.0.1:8080"
93
94
95 # User/Group
96 VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
97
98 # You may need to increase the number of open files (-n)
99 # and the maximum amount off locked memory (-l)
100 # See bug #459142
101 #rc_ulimit="-n 32786 -l 82000"
102
103
104
105 1.1 www-servers/varnish/files/varnishlog.confd
106
107 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.confd?rev=1.1&view=markup
108 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishlog.confd?rev=1.1&content-type=text/plain
109
110 Index: varnishlog.confd
111 ===================================================================
112 # /etc/conf.d/varnishlog
113
114 VARNISHLOG_OPTS="-a -w /var/log/varnish/varnishlog.log"
115
116
117
118 1.1 www-servers/varnish/files/varnishncsa.initd
119
120 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.initd?rev=1.1&view=markup
121 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishncsa.initd?rev=1.1&content-type=text/plain
122
123 Index: varnishncsa.initd
124 ===================================================================
125 #!/sbin/runscript
126 # Copyright 1999-2014 Gentoo Foundation
127 # Distributed under the terms of the GNU General Public License v2
128 # $Header: /var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishncsa.initd,v 1.1 2014/05/22 20:23:48 idl0r Exp $
129
130 VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
131
132 command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
133 command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
134 pidfile="${VARNISHNCSA_PID}"
135
136 extra_started_commands="reload rotate flush"
137
138 description_rotate="Rotate the log file"
139 description_flush="Flush any outstanding transactions"
140
141 rotate() {
142 ebegin "Rotating log file"
143 start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
144 eend $?
145 }
146
147 flush() {
148 ebegin "Flushing any outstanding transactions"
149 start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
150 eend $?
151 }
152
153 reload() {
154 flush
155 rotate
156 }
157
158
159
160 1.1 www-servers/varnish/files/varnishd.initd-r3
161
162 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.initd-r3?rev=1.1&view=markup
163 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.initd-r3?rev=1.1&content-type=text/plain
164
165 Index: varnishd.initd-r3
166 ===================================================================
167 #!/sbin/runscript
168 # Copyright 1999-2014 Gentoo Foundation
169 # Distributed under the terms of the GNU General Public License v2
170 # $Header: /var/cvsroot/gentoo-x86/www-servers/varnish/files/varnishd.initd-r3,v 1.1 2014/05/22 20:23:48 idl0r Exp $
171
172 VARNISHD_PID=${VARNISHD_PID:-/run/${SVCNAME}.pid}
173 CONFIGFILES="${CONFIGFILE:-/etc/varnish/default.vcl}"
174
175 command="${VARNISHD:-/usr/sbin/varnishd}"
176 command_args="-P ${VARNISHD_PID} -f ${CONFIGFILE} ${VARNISHD_OPTS}"
177 pidfile="${VARNISHD_PID}"
178
179 extra_commands="configtest"
180 extra_started_commands="reload"
181
182 description_configtest="Run syntax tests for configuration files."
183 description_reload="Reloads the configuration."
184
185 depend() {
186 need net
187 }
188
189 configtest() {
190 ebegin "Checking ${SVCNAME} configuration"
191 checkconfig
192 eend $?
193 }
194
195 checkconfig() {
196 ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
197 ret=$?
198 if [ $ret -ne 0 ]; then
199 eerror "${SVCNAME} has detected an error in your setup:"
200 ${VARNISHD} -C -f ${CONFIGFILE}
201 fi
202
203 return $ret
204 }
205
206 start_pre() {
207 checkconfig || return 1
208 }
209
210 stop_pre() {
211 if [ "${RC_CMD}" = "restart" ]; then
212 checkconfig || return 1
213 fi
214 }
215
216 reload() {
217 checkconfig || return 1
218
219 ebegin "Reloading varnish"
220
221 $VARNISHADM vcl.list >/dev/null 2>&1
222 ret=$?
223 if [ $ret -ne 0 ]; then
224 eerror "${SVCNAME} cannot list configuration"
225 return 1
226 fi
227
228 new_config="reload_$(date +%FT%H:%M:%S)"
229 $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
230 ret=$?
231 if [ $ret -ne 0 ]; then
232 eerror "${SVCNAME} cannot load configuration"
233 return 1
234 fi
235
236 $VARNISHADM vcl.use $new_config >/dev/null 2>&1
237 ret=$?
238 if [ $ret -ne 0 ]; then
239 eerror "${SVCNAME} cannot switch configuration"
240 return 1
241 fi
242
243 eend 0
244 }
245
246
247
248 1.1 www-servers/varnish/files/varnishd.logrotate-r2
249
250 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.logrotate-r2?rev=1.1&view=markup
251 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/varnish/files/varnishd.logrotate-r2?rev=1.1&content-type=text/plain
252
253 Index: varnishd.logrotate-r2
254 ===================================================================
255 /var/log/varnish/varnishncsa.log {
256 daily
257 rotate 31
258 copytruncate
259 dateext
260 dateyesterday
261 delaycompress
262 compress
263 notifempty
264 missingok
265
266 prerotate
267 /etc/init.d/varnishncsa -q status && /etc/init.d/varnishncsa -q flush
268 endscript
269 }
270
271 /var/log/varnish/varnishlog.log {
272 daily
273 rotate 31
274 copytruncate
275 dateext
276 dateyesterday
277 delaycompress
278 compress
279 notifempty
280 missingok
281
282 prerotate
283 /etc/init.d/varnishlog -q status && /etc/init.d/varnishlog -q flush
284 endscript
285 }