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 --pidfile $pidfile /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 /sbin/start-stop-daemon -q --stop -s QUIT --retry QUIT/600/TERM/10 --pidfile $pidfile
41 [ "$?" -eq 0 ] && ok || fail
42 rm -f /var/lock/subsys/php-fpm
44 msg_not_running "PHP FastCGI Process Manager"
51 if [ -f /var/lock/subsys/php-fpm ]; then
52 msg_reloading "PHP FastCGI Process Manager"
53 killproc --pidfile $pidfile php-fpm -$sig
56 msg_not_running "PHP FastCGI Process Manager"
62 if [ -f /var/lock/subsys/php-fpm ]; then
66 msg_not_running "PHP FastCGI Process Manager"
72 # See how we were called.
94 status php-fpm php.fpm
98 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"