sample for using mwlib 1.13

814 views
Skip to first unread message

dseichter

unread,
Dec 30, 2011, 8:47:44 AM12/30/11
to mwlib
Hello,

I'd installed several internal servers for mediawiki and the
Collection extension with own render server.
Two days ago I had to install a new one, but now I saw, that with the
update of mwlib 1.13 the mw-serve is replaced with three or four other
processes.

I did play around with runit, but I can't get the processes running as
expected.
Do you plan to publish a sample script for runit or something else,
where I am able to start one script like mw-serve in older versions,
and all given parameters will be passed through to the one of the four
files.

I know you have several reasons to do this step to delete mw-serve,
but I am not confirm in python to find what it means if I take a look
to the mw-serve-file.

Thank you in advance for help, because http://mwlib.readthedocs.org/en/latest/renderserver.html
not really helped me, how to start the render server like before.

Daniel





Ralf Schmitt

unread,
Jan 2, 2012, 4:13:20 AM1/2/12
to mw...@googlegroups.com
dseichter <dan...@dseichter.de> writes:

> Do you plan to publish a sample script for runit or something else,
> where I am able to start one script like mw-serve in older versions,
> and all given parameters will be passed through to the one of the four
> files.

no

>
> Thank you in advance for help, because http://mwlib.readthedocs.org/en/latest/renderserver.html
> not really helped me, how to start the render server like before.

the page you link to starts with:

,----
| Overview
|
| Running a renderserver consists in running multiple programs
| [1]. Unless you have some special requirements, you should be able to
| start a working renderserver by running the following commands:
|
| $ nserve.py
| $ mw-qserve
| $ nslave.py --cachedir ~/cache/
| $ postman.py
`----

You can also run these commands in a terminal (or a tmux/screen session)
while setting up the system in order to defer setting up runit or a
similar solution.


--
Cheers
Ralf

Ralf Schmitt

unread,
Jan 2, 2012, 4:19:09 AM1/2/12
to mw...@googlegroups.com
dseichter <dan...@dseichter.de> writes:

> Hello,
>
> I'd installed several internal servers for mediawiki and the
> Collection extension with own render server.
> Two days ago I had to install a new one, but now I saw, that with the
> update of mwlib 1.13 the mw-serve is replaced with three or four other
> processes.

Did you know that you can use your render server with multiple mediawiki
installations?

--
Cheers
Ralf

dseichter

unread,
Jan 2, 2012, 8:59:48 AM1/2/12
to mwlib
Hello,

> Did you know that you can use your render server with multiple mediawiki
> installations?

yes I know. The different render servers are for different customers
(at the moment there are five render servers with mwlib 0.12 and the
new one, which I installed last week). In one installation there are
four mediawiki installations sharing one instance.

Daniel

dseichter

unread,
Jan 2, 2012, 9:03:19 AM1/2/12
to mwlib
Hello,
> > Do you plan to publish a sample script for runit or something else,
> > where I am able to start one script like mw-serve in older versions,
> > and all given parameters will be passed through to the one of the four
> > files.
>
> no
Ok, then I will try to create one on my own and publish it for others.

At the moment I am working with five putty sessions, because as soon
as I am using runit, putty was closed immediately (a very strange
problem, I would solve this week. New year, new luck *g*).

Thank you for your answer, thought you will publish a sample script,
so no problem.

have a nice week,

Daniel

lifeaddict

unread,
Jan 2, 2012, 2:00:28 PM1/2/12
to mwlib
here is what we use to start:

#!/bin/sh

DAEMON="mwlibserver"
IDENT=MWS
PREFIX=/usr/local/bin
CACHEDIR=/var/spool/${DAEMON}/
IFACE=localhost
#URL="http://${IFACE}/cache/"
QPORT=14311
NPORT=8899
FPORT=8898
RUNFILE="/var/run/mwlibserver.run"

SCREENPATH=`which screen`
if [ ! -x "$SCREENPATH" ]; then
echo "please install GNU screen"
exit 1
fi

start() {
[ -e ${RUNFILE} ] && stop
[ -x ${CACHEDIR} ] || mkdir -p ${CACHEDIR}
touch $RUNFILE
echo -n "starting $DAEMON"
screen -d -m -S ${IDENT}qserv ${PREFIX}/mw-qserve -p $QPORT -i
$IFACE &
echo -n "."
screen -d -m -S ${IDENT}nserv ${PREFIX}/nserve.py --port
$NPORT ${IFACE}:${QPORT} &
echo -n "."
screen -d -m -S ${IDENT}nslave ${PREFIX}/nslave.py --cachedir
$CACHEDIR --serve-files-port $FPORT --url=${URL} --numprocs=2 &
echo -n "."
sleep 1
screen -d -m -S ${IDENT}postm ${PREFIX}/postman.py --cachedir=$
{CACHEDIR} &
echo -n "."
echo ""
}

stop() {
echo "stopping $DAEMON"
screen -list | grep \.${IDENT} | cut -d\. -f1 | xargs -r kill
-9
screen -wipe > /dev/null 2>&1
rm -f ${RUNFILE} 2>/dev/null
}

case "$1" in
start) start
;;
stop) stop
;;
status) screen -list | grep \.${IDENT} || echo "not running"
;;
restart)stop
start
;;
*) echo -n "usage:\n\t$0 (start|stop|status|restart)\n"
exit 1
;;
esac
exit 0

greets, michael

dseichter

unread,
Jan 4, 2012, 5:16:20 AM1/4/12
to mwlib
Hello,

thank you for your script. At the moment wasn't able to test it, but I
hope to be able for tomorrow.

I will report you my results.

Have a nice day,

Daniel

kenelbow

unread,
Apr 18, 2012, 8:25:16 AM4/18/12
to mw...@googlegroups.com
I saved this script in /etc/init.d/ and it works well for manually starting and stopping my mwlib 0.13.6 installation.  However if I use update-rd.d to set it to autostart at boot I get render server errors. If I manually stop and restart the mwlib everything works fine.  Any ideas?  I am running Ubuntu server 11.10 FYI. Below is a sample error I receive on my wiki.

An error occured on the render server: RuntimeError: RuntimeError: command failed with returncode 24832: ['mw-zip', '-o', '/var/spool/mwlibserver/3f/3fcd150d28c78d0e/collection.zip', '-m', '/var/spool/mwlibserver/3f/3fcd150d28c78d0e/metabook.json', '--status', 'qserve://localhost:14311/3fcd150d28c78d0e:makezip', '--config', 'http://wiki.citysecurities.com/wiki', '--template-blacklist', 'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', 'Exclude in print', '--print-template-prefix', 'Print', '--print-template-pattern', '$1/Print'] Last Output: failed to exec child process: ['mw-zip', '-o', '/var/spool/mwlibserver/3f/3fcd150d28c78d0e/collection.zip', '-m', '/var/spool/mwlibserver/3f/3fcd150d28c78d0e/metabook.json', '--status', 'qserve://localhost:14311/3fcd150d28c78d0e:makezip', '--config', 'http://wiki.citysecurities.com/wiki', '--template-blacklist', 'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', 'Exclude in print', '--print-template-prefix', 'Print', '--print-template-pattern', '$1/Print'] PATH='/sbin:/usr/sbin:/bin:/usr/bin'Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/qserve-0.2.7-py2.7.egg/qs/proc.py", line 59, in run_cmd os.execvp(args[0], args) File "/usr/lib/python2.7/os.py", line 344, in execvp _execvpe(file, args) File "/usr/lib/python2.7/os.py", line 380, in _execvpe func(fullname, *argrest) OSError: [Errno 2] No such file or directory in function system, file /usr/local/lib/python2.7/dist-packages/mwlib-0.13.6-py2.7-linux-x86_64.egg/EGG-INFO/scripts/nslave.py, line 63 in function qaddw, file /usr/local/lib/python2.7/dist-packages/qserve-0.2.7-py2.7.egg/qs/slave.py, line 66 

lijn

unread,
Aug 23, 2012, 8:56:59 AM8/23/12
to mw...@googlegroups.com
You are probably running mwlibserver from a virtualenv. The virtualenv has a special $PATH variable that also has the bin-dir from the virtualenv in it.
If you include the correct $PATH in your startup-script it'll run fine. To find the correct value for $PATH, you can run 'echo $PATH' in your virtualenv and copy/paste that into your script.
Reply all
Reply to author
Forward
0 new messages