Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #2011 - Luciano Silva lucianoes@ufrgs.br
- #Bash Script for start stop service spawn-fcgi with perl request tracker
- ### BEGIN INIT INFO
- # Provides: spawn-fcgi
- # Required-Start: $all
- # Required-Stop: $all
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: starts FastCGI for PHP
- # Description: starts FastCGI for PHP using start-stop-daemon
- ### END INIT INFO
- USER=www-data
- GROUP=www-data
- CHILDREN=6
- HOST=127.0.0.1
- PORT=9000
- PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- NAME=spawn-fcgi-perl
- PID=/var/run/spawn-fcgi.pid
- DAEMON=/usr/bin/spawn-fcgi
- DAEMON_OPTS="-f /opt/rt4/sbin/rt-server.fcgi -a $HOST -p $PORT -C $CHILDREN -u $USER -g $GROUP -P $PID"
- test -x $DAEMON || exit 0
- set -e
- case "$1" in
- start)
- echo "Starting $NAME: "
- start-stop-daemon --start --pidfile $PID --exec $DAEMON -- $DAEMON_OPTS
- echo "done."
- ;;
- stop)
- echo "Stopping $NAME: "
- start-stop-daemon --stop --pidfile $PID --retry 5
- rm -f $PID
- echo "done."
- ;;
- restart)
- echo "Stopping $NAME: "
- start-stop-daemon --stop --pidfile $PID --retry 5
- rm -f $PID
- echo "done..."
- sleep 1
- echo "Starting $NAME: "
- start-stop-daemon --start --pidfile $PID --exec $DAEMON -- $DAEMON_OPTS
- echo "done."
- ;;
- *)
- echo "Usage: /etc/init.d/$NAME {start|stop|restart}" >&2
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement