1 |
dev-zero 13/07/01 13:56:29 |
2 |
|
3 |
Added: nserve.logrotate |
4 |
0.15.8-nslave-add-address-parameter.patch |
5 |
nserve.confd mwlib-purge-cache.cron mw-qserve.confd |
6 |
postman.logrotate nserve.initd postman.confd |
7 |
postman.initd mw-qserve.initd nslave.initd |
8 |
nslave.logrotate mw-qserve.logrotate nslave.confd |
9 |
Log: |
10 |
Add init.d scripts to manage servers, thanks to Pat Kläy and Christian Affolter. Add patch which adds an address parameter to nslave. |
11 |
|
12 |
(Portage version: 2.1.11.63/cvs/Linux x86_64, signed Manifest commit with key 0x1E0CA85F!) |
13 |
|
14 |
Revision Changes Path |
15 |
1.1 dev-python/mwlib/files/nserve.logrotate |
16 |
|
17 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nserve.logrotate?rev=1.1&view=markup |
18 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nserve.logrotate?rev=1.1&content-type=text/plain |
19 |
|
20 |
Index: nserve.logrotate |
21 |
=================================================================== |
22 |
/var/log/mwlib/nserve.log { |
23 |
su mwlib mwlib |
24 |
missingok |
25 |
postrotate |
26 |
/etc/init.d/nserve restart > /dev/null 2>&1 |
27 |
endscript |
28 |
} |
29 |
|
30 |
|
31 |
|
32 |
1.1 dev-python/mwlib/files/0.15.8-nslave-add-address-parameter.patch |
33 |
|
34 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/0.15.8-nslave-add-address-parameter.patch?rev=1.1&view=markup |
35 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/0.15.8-nslave-add-address-parameter.patch?rev=1.1&content-type=text/plain |
36 |
|
37 |
Index: 0.15.8-nslave-add-address-parameter.patch |
38 |
=================================================================== |
39 |
diff --git a/mwlib/nslave.py b/mwlib/nslave.py |
40 |
index d3f8fc0..cccfc7a 100755 |
41 |
--- a/mwlib/nslave.py |
42 |
+++ b/mwlib/nslave.py |
43 |
@@ -184,7 +184,7 @@ class commands(object): |
44 |
return doit(**params) |
45 |
|
46 |
|
47 |
-def start_serving_files(cachedir, port): |
48 |
+def start_serving_files(cachedir, address, port): |
49 |
from gevent.pywsgi import WSGIServer |
50 |
from bottle import route, static_file, default_app |
51 |
cachedir = os.path.abspath(cachedir) |
52 |
@@ -195,7 +195,7 @@ def start_serving_files(cachedir, port): |
53 |
if filename.endswith(".rl"): |
54 |
response.headers["Content-Disposition"] = "inline; filename=collection.pdf" |
55 |
return response |
56 |
- s = WSGIServer(("", port), default_app()) |
57 |
+ s = WSGIServer((address, port), default_app()) |
58 |
s.start() |
59 |
return s |
60 |
|
61 |
@@ -212,10 +212,11 @@ def make_cachedir(cachedir): |
62 |
def main(): |
63 |
global cachedir, cacheurl |
64 |
numgreenlets = 10 |
65 |
+ http_address = 'localhost' |
66 |
http_port = 8898 |
67 |
serve_files = True |
68 |
from mwlib import argv |
69 |
- opts, args = argv.parse(sys.argv[1:], "--no-serve-files --serve-files-port= --serve-files --cachedir= --url= --numprocs=") |
70 |
+ opts, args = argv.parse(sys.argv[1:], "--no-serve-files --serve-files-port= --serve-files-address= --serve-files --cachedir= --url= --numprocs=") |
71 |
for o, a in opts: |
72 |
if o == "--cachedir": |
73 |
cachedir = a |
74 |
@@ -227,12 +228,14 @@ def main(): |
75 |
serve_files = False |
76 |
elif o == "--serve-files-port": |
77 |
http_port = int(a) |
78 |
+ elif o == "--serve-files-address": |
79 |
+ http_address = str(a) |
80 |
|
81 |
if cachedir is None: |
82 |
sys.exit("nslave: missing --cachedir argument") |
83 |
|
84 |
if serve_files: |
85 |
- wsgi_server = start_serving_files(cachedir, http_port) |
86 |
+ wsgi_server = start_serving_files(cachedir, http_address, http_port) |
87 |
port = wsgi_server.socket.getsockname()[1] |
88 |
if not cacheurl: |
89 |
cacheurl = "http://%s:%s/cache" % (find_ip(), port) |
90 |
|
91 |
|
92 |
|
93 |
1.1 dev-python/mwlib/files/nserve.confd |
94 |
|
95 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nserve.confd?rev=1.1&view=markup |
96 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nserve.confd?rev=1.1&content-type=text/plain |
97 |
|
98 |
Index: nserve.confd |
99 |
=================================================================== |
100 |
# The port on which the mw-qserve service is listening |
101 |
MW_QSERVE_PORT=14311 |
102 |
|
103 |
# The interface on which the mw-qserve is listening (for example: 127.0.0.1) |
104 |
MW_QSERVE_INTERFACE="127.0.0.1" |
105 |
|
106 |
# The port to listen to |
107 |
NSERVE_PORT=8899 |
108 |
|
109 |
# The interface to listen to (for example: 127.0.0.1) |
110 |
NSERVE_INTERFACE="127.0.0.1" |
111 |
|
112 |
# The user running the nserve service, defaults to 'mwlib' |
113 |
# NSERVE_USER="mwlib" |
114 |
|
115 |
# The group running the nserve service, defaults to 'mwlib' |
116 |
# NSERVE_GROUP="mwlib" |
117 |
|
118 |
# The logfile collecting all output from stdout and stderr, comment out for no logging |
119 |
NSERVE_LOGFILE="/var/log/mwlib/nserve.log" |
120 |
|
121 |
|
122 |
|
123 |
1.1 dev-python/mwlib/files/mwlib-purge-cache.cron |
124 |
|
125 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mwlib-purge-cache.cron?rev=1.1&view=markup |
126 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mwlib-purge-cache.cron?rev=1.1&content-type=text/plain |
127 |
|
128 |
Index: mwlib-purge-cache.cron |
129 |
=================================================================== |
130 |
# purge mw-serve cache directory |
131 |
# --cache-dir=DIR: the NSLAVE_CACHEDIR directory specified in /etc/conf.d/nslave |
132 |
# --purge-cache=HOURS: remove cache files that have not been touched for at east HOURS hours |
133 |
00 23 * * * sudo -u mwlib mw-serve-ctl --cache-dir=/var/cache/mw-serve --purge-cache=24 |
134 |
|
135 |
|
136 |
|
137 |
1.1 dev-python/mwlib/files/mw-qserve.confd |
138 |
|
139 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mw-qserve.confd?rev=1.1&view=markup |
140 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mw-qserve.confd?rev=1.1&content-type=text/plain |
141 |
|
142 |
Index: mw-qserve.confd |
143 |
=================================================================== |
144 |
# The port to listen to |
145 |
MW_QSERVE_PORT=14311 |
146 |
|
147 |
# The interface to listen to (for example: 127.0.0.1) |
148 |
MW_QSERVE_INTERFACE="127.0.0.1" |
149 |
|
150 |
# The user running the mw-qserve service, defaults to 'mwlib' |
151 |
# MW_QSERVE_USER="mwlib" |
152 |
|
153 |
# The group running the mq-qserve service, defaults to 'mwlib' |
154 |
# MW_QSERVE_GROUP="mwlib" |
155 |
|
156 |
# The logfile collecting all output from stdout and stderr, comment out for no logging |
157 |
MW_QSERVE_LOGFILE="/var/log/mwlib/mw-qserve.log" |
158 |
|
159 |
|
160 |
|
161 |
1.1 dev-python/mwlib/files/postman.logrotate |
162 |
|
163 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/postman.logrotate?rev=1.1&view=markup |
164 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/postman.logrotate?rev=1.1&content-type=text/plain |
165 |
|
166 |
Index: postman.logrotate |
167 |
=================================================================== |
168 |
/var/log/mwlib/postman.log { |
169 |
su mwlib mwlib |
170 |
missingok |
171 |
postrotate |
172 |
/etc/init.d/postman restart > /dev/null 2>&1 |
173 |
endscript |
174 |
} |
175 |
|
176 |
|
177 |
|
178 |
1.1 dev-python/mwlib/files/nserve.initd |
179 |
|
180 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nserve.initd?rev=1.1&view=markup |
181 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nserve.initd?rev=1.1&content-type=text/plain |
182 |
|
183 |
Index: nserve.initd |
184 |
=================================================================== |
185 |
#!/sbin/runscript |
186 |
# Copyright 1999-2013 Gentoo Foundation |
187 |
# Distributed under the terms of the GNU General Public License v2 |
188 |
# $Header: /var/cvsroot/gentoo-x86/dev-python/mwlib/files/nserve.initd,v 1.1 2013/07/01 13:56:29 dev-zero Exp $ |
189 |
|
190 |
description="nserve is a HTTP server which distributes received jobs to a mw-qserve instance" |
191 |
|
192 |
command="/usr/bin/nserve" |
193 |
command_args="--port=${NSERVE_PORT} \ |
194 |
--interface=${NSERVE_INTERFACE} \ |
195 |
--qserve=${MW_QSERVE_INTERFACE}:${MW_QSERVE_PORT}" |
196 |
|
197 |
pidfile="/var/run/${SVCNAME}.pid" |
198 |
command_background="yes" |
199 |
|
200 |
start_stop_daemon_args="--user ${NSERVE_USER:-mwlib} \ |
201 |
--group ${NSERVE_GROUP:-mwlib} \ |
202 |
${NSERVE_LOGFILE:+--stderr ${NSERVE_LOGFILE}} \ |
203 |
${NSERVE_LOGFILE:+--stdout ${NSERVE_LOGFILE}}" |
204 |
|
205 |
depend() { |
206 |
need net localmount |
207 |
use mw-qserve |
208 |
} |
209 |
|
210 |
|
211 |
|
212 |
1.1 dev-python/mwlib/files/postman.confd |
213 |
|
214 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/postman.confd?rev=1.1&view=markup |
215 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/postman.confd?rev=1.1&content-type=text/plain |
216 |
|
217 |
Index: postman.confd |
218 |
=================================================================== |
219 |
# The cache-directory to which the collections are saved, make sure you enter |
220 |
# the same directory as in /etc/conf.d/nslave |
221 |
POSTMAN_CACHEDIR="/var/cache/mwlib/" |
222 |
|
223 |
# The user running the postman service, defaults to 'mwlib' |
224 |
# POSTMAN_USER="mwlib" |
225 |
|
226 |
# The group running the postman service, defaults to 'mwlib' |
227 |
# POSTMAN_GROUP="mwlib" |
228 |
|
229 |
# The logfile collecting all output from stdout and stderr, comment out for no logging |
230 |
POSTMAN_LOGFILE="/var/log/mwlib/postman.log" |
231 |
|
232 |
|
233 |
|
234 |
1.1 dev-python/mwlib/files/postman.initd |
235 |
|
236 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/postman.initd?rev=1.1&view=markup |
237 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/postman.initd?rev=1.1&content-type=text/plain |
238 |
|
239 |
Index: postman.initd |
240 |
=================================================================== |
241 |
#!/sbin/runscript |
242 |
# Copyright 1999-2013 Gentoo Foundation |
243 |
# Distributed under the terms of the GNU General Public License v2 |
244 |
# $Header: /var/cvsroot/gentoo-x86/dev-python/mwlib/files/postman.initd,v 1.1 2013/07/01 13:56:29 dev-zero Exp $ |
245 |
|
246 |
description="postman uploads zip collections to pediapress in case someone likes to order printed books" |
247 |
|
248 |
command="/usr/bin/postman" |
249 |
command_args="--cachedir=${POSTMAN_CACHDIR}" |
250 |
|
251 |
pidfile="/var/run/${SVCNAME}.pid" |
252 |
command_background="yes" |
253 |
|
254 |
start_stop_daemon_args="--user ${POSTMAN_USER:-mwlib} \ |
255 |
--group ${POSTMAN_GROUP:-mwlib} \ |
256 |
${POSTMAN_LOGFILE:+--stderr ${POSTMAN_LOGFILE}} \ |
257 |
${POSTMAN_LOGFILE:+--stdout ${POSTMAN_LOGFILE}}" |
258 |
|
259 |
depend() { |
260 |
need net localmount |
261 |
} |
262 |
|
263 |
|
264 |
|
265 |
1.1 dev-python/mwlib/files/mw-qserve.initd |
266 |
|
267 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mw-qserve.initd?rev=1.1&view=markup |
268 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mw-qserve.initd?rev=1.1&content-type=text/plain |
269 |
|
270 |
Index: mw-qserve.initd |
271 |
=================================================================== |
272 |
#!/sbin/runscript |
273 |
# Copyright 1999-2013 Gentoo Foundation |
274 |
# Distributed under the terms of the GNU General Public License v2 |
275 |
# $Header: /var/cvsroot/gentoo-x86/dev-python/mwlib/files/mw-qserve.initd,v 1.1 2013/07/01 13:56:29 dev-zero Exp $ |
276 |
|
277 |
description="mw-qserve is a job queue server used to distribute and manage jobs" |
278 |
|
279 |
command="/usr/bin/mw-qserve" |
280 |
command_args="--interface=${MW_QSERVE_INTERFACE} --port=${MW_QSERVE_PORT}" |
281 |
|
282 |
pidfile="/var/run/${SVCNAME}.pid" |
283 |
command_background="yes" |
284 |
|
285 |
start_stop_daemon_args="--user ${MW_QSERVE_USER:-mwlib} \ |
286 |
--group ${MW_QSERVE_GROUP:-mwlib} \ |
287 |
${MW_QSERVE_LOGFILE:+--stderr ${MW_QSERVE_LOGFILE}} \ |
288 |
${MW_QSERVE_LOGFILE:+--stdout ${MW_QSERVE_LOGFILE}}" |
289 |
|
290 |
depend() { |
291 |
need net localmount |
292 |
} |
293 |
|
294 |
|
295 |
|
296 |
1.1 dev-python/mwlib/files/nslave.initd |
297 |
|
298 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nslave.initd?rev=1.1&view=markup |
299 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nslave.initd?rev=1.1&content-type=text/plain |
300 |
|
301 |
Index: nslave.initd |
302 |
=================================================================== |
303 |
#!/sbin/runscript |
304 |
# Copyright 1999-2013 Gentoo Foundation |
305 |
# Distributed under the terms of the GNU General Public License v2 |
306 |
# $Header: /var/cvsroot/gentoo-x86/dev-python/mwlib/files/nslave.initd,v 1.1 2013/07/01 13:56:29 dev-zero Exp $ |
307 |
|
308 |
description="nslave pulls new jobs from a mw-qserve instance" |
309 |
|
310 |
command="/usr/bin/nslave" |
311 |
command_args="--cachedir=${NSLAVE_CACHEDIR} \ |
312 |
--serve-files-address=${NSLAVE_ADDRESS} \ |
313 |
--serve-files-port=${NSLAVE_PORT} \ |
314 |
--url=${NSLAVE_URL} \ |
315 |
--numprocs=${NSLAVE_NUMPROCS}" |
316 |
|
317 |
pidfile="/var/run/${SVCNAME}.pid" |
318 |
command_background="yes" |
319 |
|
320 |
start_stop_daemon_args="--user ${NSLAVE_USER:-mwlib} \ |
321 |
--group ${NSLAVE_GROUP:-mwlib} \ |
322 |
${NSLAVE_LOGFILE-:+-stderr ${NSLAVE_LOGFILE}} \ |
323 |
${NSLAVE_LOGFILE:+--stdout ${NSLAVE_LOGFILE}} \ |
324 |
--umask ${NSLAVE_UMASK}" |
325 |
|
326 |
depend() { |
327 |
need net localmount |
328 |
use mw-qserve |
329 |
} |
330 |
|
331 |
|
332 |
|
333 |
1.1 dev-python/mwlib/files/nslave.logrotate |
334 |
|
335 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nslave.logrotate?rev=1.1&view=markup |
336 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nslave.logrotate?rev=1.1&content-type=text/plain |
337 |
|
338 |
Index: nslave.logrotate |
339 |
=================================================================== |
340 |
/var/log/mwlib/nslave.log { |
341 |
su mwlib mwlib |
342 |
missingok |
343 |
postrotate |
344 |
/etc/init.d/nslave restart > /dev/null 2>&1 |
345 |
endscript |
346 |
} |
347 |
|
348 |
|
349 |
|
350 |
1.1 dev-python/mwlib/files/mw-qserve.logrotate |
351 |
|
352 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mw-qserve.logrotate?rev=1.1&view=markup |
353 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/mw-qserve.logrotate?rev=1.1&content-type=text/plain |
354 |
|
355 |
Index: mw-qserve.logrotate |
356 |
=================================================================== |
357 |
/var/log/mwlib/mw-qserve.log { |
358 |
su mwlib mwlib |
359 |
missingok |
360 |
postrotate |
361 |
/etc/init.d/mw-qserve restart > /dev/null 2>&1 |
362 |
endscript |
363 |
} |
364 |
|
365 |
|
366 |
|
367 |
1.1 dev-python/mwlib/files/nslave.confd |
368 |
|
369 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nslave.confd?rev=1.1&view=markup |
370 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/mwlib/files/nslave.confd?rev=1.1&content-type=text/plain |
371 |
|
372 |
Index: nslave.confd |
373 |
=================================================================== |
374 |
# The address to serve the rendered files to the wiki |
375 |
NSLAVE_ADDRESS="localhost" |
376 |
|
377 |
# The port to serve the rendered files to the wiki |
378 |
NSLAVE_PORT=8898 |
379 |
|
380 |
# The url to serve the rendered files to the wiki |
381 |
NSLAVE_URL="http://${NSLAVE_ADDRESS}:${NSLAVE_PORT}" |
382 |
|
383 |
# The directory to save the rendered PDFs to |
384 |
NSLAVE_CACHEDIR="/var/cache/mwlib/" |
385 |
|
386 |
# The umask to create files in NSLAVE_CACHEDIR |
387 |
NSLAVE_UMASK=027 |
388 |
|
389 |
# How many greenlets are allowed to run in parallel |
390 |
NSLAVE_NUMPROCS=10 |
391 |
|
392 |
# The user running the nserve service, defaults to 'mwlib' |
393 |
# NSLAVE_USER="mwlib" |
394 |
|
395 |
# The group running the nserve service, defaults to 'mwlib' |
396 |
# NSLAVE_GROUP="mwlib" |
397 |
|
398 |
# The logfile collecting all output from stdout and stderr, comment out for no logging |
399 |
NSLAVE_LOGFILE="/var/log/mwlib/nslave.log" |