8 CGI_NAME=/usr/bin/mctxserv
9 CGI_BASENAME=`basename $CGI_NAME`
10 PID=/var/run/$CGI_BASENAME.pid
11 DAEMON=/usr/bin/spawn-fcgi
12 DAEMON_BASENAME=`basename $DAEMON`
13 DAEMON_OPTS="-a $HOST -p $PORT -u $USER -g $GROUP -P $PID $CGI_NAME"
15 #Test if daemon exists
16 [ -x "$DAEMON" ] || (echo $DAEMON doesn\'t exist! && exit 1)
17 #Test if cgi module exists
18 [ -x "$CGI_NAME" ] || (echo $CGI_BASENAME doesn\'t exist! && exit 1)
21 echo -n "Starting FastCGI Daemon: "
22 start-stop-daemon --start --quiet --pidfile $PID \
23 --exec $DAEMON -- $DAEMON_OPTS > /dev/null
28 echo -n "Stopping FastCGI Daemon: "
29 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PID
46 echo "Usage: mctxserv {start|stop|restart}"