hi
I fund a luncher for MwLib server.
The options {start, stop, restart, status}.
it is operational to start nSlave nserv mw-qserve
ideal for start service
with the pleasure of sharing
--
You received this message because you are subscribed to the Google Groups
"mwlib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
#!/bin/sh
DAEMON="mwlibserver"
IDENT=MWS
PREFIX=/usr/local/bin
CACHEDIR=/var/spool/${DAEMON}/
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
echo -n "starting $DAEMON"
screen -d -m -S ${IDENT}nserve ${PREFIX}/nserve >> /var/log/nserve/nserve.log &
echo -n "."
screen -d -m -S ${IDENT}qserve ${PREFIX}/mw-qserve >> /var/log/nserve/mw-qserve.log &
echo -n "."
screen -d -m -S ${IDENT}nslave ${PREFIX}/nslave --cachedir ~/cache/ >> /var/log/nserve/nslave.log &
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