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
14 # Source function library
15 . /etc/rc.d/init.d/functions
18 . /etc/sysconfig/network
20 pidfile=/var/run/php/php-fpm.pid
21 lockfile=/var/lock/subsys/php-fpm
24 # Check if the service is already running?
25 if [ -f $lockfile ]; then
26 msg_already_running "PHP FastCGI Process Manager"
30 msg_starting "PHP FastCGI Process Manager"
31 daemon --pidfile $pidfile /usr/sbin/php-fpm --fpm-config /etc/php/php-fpm.conf
33 [ $RETVAL -eq 0 ] && touch $lockfile
37 if [ ! -f $lockfile ]; then
38 msg_not_running "PHP FastCGI Process Manager"
43 msg_stopping "PHP FastCGI Process Manager"
44 # always gracefully shut down php-fpm
45 /sbin/start-stop-daemon -q --stop -s QUIT --retry QUIT/600/TERM/10 --pidfile $pidfile
46 [ "$?" -eq 0 ] && ok || fail
53 if [ ! -f $lockfile ]; then
54 msg_not_running "PHP FastCGI Process Manager"
59 msg_reloading "PHP FastCGI Process Manager"
60 killproc --pidfile $pidfile php-fpm -$sig
65 if [ ! -f $lockfile ]; then
66 msg_not_running "PHP FastCGI Process Manager"
76 # See how we were called.
102 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"