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 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