Created
November 17, 2009 22:14
-
-
Save phred/237322 to your computer and use it in GitHub Desktop.
init.d script example for controlling a PHP FastCGI pool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# chkconfig: - 85 15 | |
# description: controls the pool of PHP FastCGI daemons used to handle \ | |
# dynamic requests from nginx. | |
PHP_SCRIPT=/opt/nginx/bin/world_php_fcgi | |
RETVAL=0 | |
case "$1" in | |
start) | |
$PHP_SCRIPT | |
RETVAL=$? | |
;; | |
stop) | |
killall -9 php-cgi | |
RETVAL=$? | |
;; | |
restart) | |
killall -9 php-cgi | |
$PHP_SCRIPT | |
RETVAL=$? | |
;; | |
*) | |
echo "Usage: php-fastcgi {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment