r44734 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44733‎ | r44734 | r44735 >
Date:21:12, 17 December 2008
Author:brion
Status:deferred
Tags:
Comment:
Quickie init script for PediaPress mw-serve
Modified paths:
  • /trunk/tools/mw-serve (added) (history)
  • /trunk/tools/mw-serve/README (added) (history)
  • /trunk/tools/mw-serve/mw-serve.sh (added) (history)

Diff [purge]

Index: trunk/tools/mw-serve/README
@@ -0,0 +1,2 @@
 2+This is a quickie init script for the PediaPress mw-serve,
 3+which I threw together for bindery.wikimedia.org.
Property changes on: trunk/tools/mw-serve/README
___________________________________________________________________
Added: svn:eol-style
14 + native
Index: trunk/tools/mw-serve/mw-serve.sh
@@ -0,0 +1,55 @@
 2+#! /bin/sh
 3+
 4+case "$1" in
 5+start)
 6+
 7+echo "Starting mw-serve... "
 8+# defaults to FastCGI, port 8899 on localhost, no daemonization
 9+su -c "PYTHONPATH=/opt/mwlib/lib/python2.5/site-packages \
 10+PATH=/usr/bin:/bin:/opt/mwlib/bin \
 11+PYTHON_EGG_CACHE=/opt/mwlib/var/cache/python-eggs \
 12+/opt/mwlib/bin/mw-serve \
 13+ -i bindery.wikimedia.org \
 14+ -p 8080 \
 15+ -P http \
 16+ -d \
 17+ --cache-dir='/opt/mwlib/var/cache/pdfserver/' \
 18+ --mwrender-logfile='/opt/mwlib/var/log/mw-pdf.log' \
 19+ --mwzip-logfile='/opt/mwlib/var/log/mw-zip.log' \
 20+ --mwpost-logfile='/opt/mwlib/var/log/mw-post.log' \
 21+ --logfile='/opt/mwlib/var/log/mw-serve.log' \
 22+ --pid-file='/opt/mwlib/var/run/mw-serve.pid' \
 23+ --report-from-mail=error_wmf@pediapress.com \
 24+ --report-recipient=error_wmf@pediapress.com" www-data
 25+;;
 26+
 27+stop)
 28+PIDFILE=/opt/mwlib/var/run/mw-serve.pid
 29+if [ -e $PIDFILE ]; then
 30+ PID=`cat $PIDFILE`
 31+ echo -n "Stopping mw-serve, killing PID $PID..."
 32+ if ! kill $PID; then
 33+ echo "can't kill it."
 34+ else
 35+ echo "done."
 36+ rm -f $PIDFILE
 37+ fi
 38+else
 39+ echo "mw-serve does not appear to be running."
 40+fi
 41+;;
 42+
 43+reload|force-reload)
 44+echo "Reload not supported for mw-serve yet."
 45+;;
 46+
 47+restart)
 48+"$0" stop && "$0" start
 49+;;
 50+
 51+*)
 52+echo "Usage: /etc/init.d/mw-serve {start|stop|restart}"
 53+exit 1
 54+esac
 55+
 56+exit 0
Property changes on: trunk/tools/mw-serve/mw-serve.sh
___________________________________________________________________
Added: svn:eol-style
157 + native
Added: svn:executable
258 + *

Status & tagging log