]> git.pld-linux.org Git - packages/php.git/blobdiff - php-fpm.init
- fix for pcre 8.30 (do not use pcre_info deprecated 12 years ago)
[packages/php.git] / php-fpm.init
index 830fdb4080fedf52ab258a9fe5934375a64c2c19..9ffee5e2f712f84d4b0482904d21bcb663f6aa1e 100644 (file)
@@ -6,8 +6,8 @@
 #
 # description: PHP FastCGI Process Manager
 #
-# processname: php.fpm
-# config:      /etc/php/fpm.conf
+# processname: php-fpm
+# config:      /etc/php/php-fpm.conf
 # pidfile:     /var/run/php/fpm.pid
 #
 # $Id$
@@ -24,7 +24,7 @@ start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/php-fpm ]; then
                msg_starting "PHP FastCGI Process Manager"
-               daemon /usr/bin/php.fpm --fpm --fpm-config /etc/php/fpm.conf
+               daemon --pidfile $pidfile /usr/sbin/php-fpm --fpm-config /etc/php/php-fpm.conf
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fpm
        else
@@ -36,19 +36,9 @@ stop() {
        if [ -f /var/lock/subsys/php-fpm ]; then
                # Stop daemons.
                msg_stopping "PHP FastCGI Process Manager"
-               killproc --pidfile $pidfile php-fpm -TERM
-               rm -f /var/lock/subsys/php-fpm
-       else
-               msg_not_running "PHP FastCGI Process Manager"
-       fi
-}
-
-# Gracefully shutting down php_fpm
-quit() {
-       if [ -f /var/lock/subsys/php-fpm ]; then
-               # Stop daemons.
-               msg_stopping "PHP FastCGI Process Manager"
-               killproc --pidfile $pidfile php-fpm -QUIT
+               # always gracefully shut down php-fpm
+               /sbin/start-stop-daemon -q --stop -s QUIT --retry QUIT/600/TERM/10 --pidfile $pidfile
+               [ "$?" -eq 0 ] && ok || fail
                rm -f /var/lock/subsys/php-fpm
        else
                msg_not_running "PHP FastCGI Process Manager"
@@ -84,7 +74,7 @@ case "$1" in
   start)
        start
        ;;
-  stop)
+  stop|quit)
        stop
        ;;
   restart)
@@ -97,14 +87,11 @@ case "$1" in
   reload|force-reload)
        reload USR2 7
        ;;
-  quit) # graceful shutdown
-       quit
-       ;;
   flush-logs|logrotate)
        reload USR1 0
        ;;
   status)
-       status php-fpm php.fpm
+       status php-fpm
        RETVAL=$?
        ;;
   *)
This page took 0.046246 seconds and 4 git commands to generate.