3 # php-fpm PHP FastCGI Process Manager
7 # description: PHP FastCGI Process Manager
10 # config: /etc/php/fpm.conf
11 # pidfile: /var/run/php/fpm.pid
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
21 pidfile=/var/run/php/fpm.pid
24 # Check if the service is already running?
25 if [ ! -f /var/lock/subsys/php-fpm ]; then
26 msg_starting "PHP FastCGI Process Manager"
27 daemon /usr/bin/php.fpm --fpm --fpm-config /etc/php/fpm.conf
29 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fpm
31 msg_already_running "PHP FastCGI Process Manager"
36 if [ -f /var/lock/subsys/php-fpm ]; then
38 msg_stopping "PHP FastCGI Process Manager"
39 # always gracefully shut down php-fpm
40 killproc --pidfile $pidfile php-fpm -QUIT
41 rm -f /var/lock/subsys/php-fpm
43 msg_not_running "PHP FastCGI Process Manager"
50 if [ -f /var/lock/subsys/php-fpm ]; then
51 msg_reloading "PHP FastCGI Process Manager"
52 killproc --pidfile $pidfile php-fpm -$sig
55 msg_not_running "PHP FastCGI Process Manager"
61 if [ -f /var/lock/subsys/php-fpm ]; then
65 msg_not_running "PHP FastCGI Process Manager"
71 # See how we were called.
93 status php-fpm php.fpm
97 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"