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 


On Monday, January 2, 2012 2:00:28 PM UTC-5, Michael Habacher wrote:
>
> 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 
>
> On 2 Jan., 15:03, dseichter <[email protected]> wrote: 
> > 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

-- 
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/mwlib/-/1jhRtfzdhTcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mwlib?hl=en.

Reply via email to