Skip to content

Instantly share code, notes, and snippets.

@johnf
Created December 19, 2011 08:57
Show Gist options
  • Save johnf/1496171 to your computer and use it in GitHub Desktop.
Save johnf/1496171 to your computer and use it in GitHub Desktop.
php-fastcgi
# php-fastcgi - Manages php5-cgi in FastCGI mode
description "Manage a PHP FastCGI process"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
env PHP_FCGI_CHILDREN=8
env PHP_FCGI_MAX_REQUESTS=1000
respawn
pre-start script
test -x /usr/bin/spawn-fcgi || { stop; exit 0; }
test -x /usr/bin/php5-cgi || { stop; exit 0; }
end script
exec start-stop-daemon --start --exec /usr/bin/php5-cgi --pidfile /var/run/php-fastcgi/php-fastcgi.pid --make-pidfile --chuid www-data --background -- -b /var/run/php-fastcgi/spawn-fcgi-php.socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment