diff -r 000000000000 -r 888b9724f601 gmyth-stream/server/0.3/data/gmsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/server/0.3/data/gmsd Tue Aug 21 20:04:23 2007 +0100 @@ -0,0 +1,61 @@ +#!/bin/sh + +PROGRAM_NAME=GMS +PROGRAM_BIN=/usr/bin/gms.py +PIDFILE=/var/run/gms.pid +LOGFILE=/var/log/gms.log + +test -x $PROGRAM_BIN || exit 0 + +set -e + +. /lib/lsb/init-functions +. /etc/default/rcS + +case $1 in + start) + echo -n "Starting $PROGRAM_NAME: " + if [ -f $PIDFILE ] + then + PID=`cat $PIDFILE` + + if ps ax | grep -q "^$PID" + then + echo "$PROGRAM_NAME already running." + else + rm -f $PIDFILE + $PROGRAM_BIN -d > $LOGFILE + echo "OK" + fi + else + $PROGRAM_BIN -d > $LOGFILE + echo "OK" + fi + ;; + + stop) + echo -n "Stopping $PROGRAM_NAME: " + if [ -f $PIDFILE ] + then + PID=`cat $PIDFILE` + if ps ax | grep -q "^$PID" + then + kill -10 $PID + fi + rm $PIDFILE + else + echo "No $PROGRAM_NAME found running; no killed." + fi + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + log_success_msg "Usage: $0 {stop|start|restart}" + exit 1 + ;; +esac