3 # @processname@ PHP FastCGI Process Manager
7 # description: PHP FastCGI Process Manager
9 # processname: @processname@
10 # config: /etc/php/fpm.conf
11 # pidfile: /var/run/php/@processname@.pid
14 # Source function library
15 . /etc/rc.d/init.d/functions
18 . /etc/sysconfig/network
20 pidfile=/var/run/php/@processname@.pid
21 lockfile=/var/lock/subsys/@processname@
24 # Check if the service is already running?
25 if [ -f $lockfile ]; then
26 msg_already_running "PHP FastCGI Process Manager (@processname@)"
30 msg_starting "PHP FastCGI Process Manager (@processname@)"
31 daemon --pidfile $pidfile /usr/sbin/@processname@ --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 (@processname@)"
43 msg_stopping "PHP FastCGI Process Manager (@processname@)"
44 # always gracefully shut down @processname@
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 (@processname@)"
59 msg_reloading "PHP FastCGI Process Manager (@processname@)"
60 killproc --pidfile $pidfile @processname@ -$sig
65 if [ ! -f $lockfile ]; then
66 msg_not_running "PHP FastCGI Process Manager (@processname@)"
76 # See how we were called.
102 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"