Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ### BEGIN INIT INFO
- # Provides: php-fcgi-songteksten.net
- # Required-Start: $network $syslog
- # Required-Stop: $network
- # Default-Start: 2 3 5
- # Default-Stop:
- # Description: Start Nginx PHP fcgi server for songteksten.net
- ### END INIT INFO
- BIND=127.0.0.1:9000
- USER=songteksten.net
- PHP_FCGI_CHILDREN=8
- PHP_FCGI_MAX_REQUESTS=2500
- PHP_CGI=/usr/bin/php-cgi
- PHP_CGI_NAME=`basename $PHP_CGI`
- PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS PHPRC=/home/songteksten.net/etc/php5 $PHP_CGI -b $BIND"
- RETVAL=0
- start() {
- echo -n "Starting PHP FastCGI: "
- start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
- RETVAL=$?
- echo "$PHP_CGI_NAME."
- }
- stop() {
- echo -n "Stopping PHP FastCGI: "
- killall -q -w -u $USER $PHP_CGI
- RETVAL=$?
- echo "$PHP_CGI_NAME."
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- *)
- echo "Usage: php-fcgi {start|stop|restart}"
- exit 1
- ;;
- esac
- exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement