]> git.pld-linux.org Git - packages/php.git/blobdiff - php-fpm.init
- rel 8; fixes SECURITY bug; phpinfo leak; https://www.sektioneins.de/en/blog/14...
[packages/php.git] / php-fpm.init
index 5da5db06e4d88b4d291e77f6d944b62f42fe66a8..6cc104acf01af43b71479a04a71aaac67480c2e9 100644 (file)
@@ -8,7 +8,7 @@
 #
 # processname: @processname@
 # config:      /etc/php/fpm.conf
-# pidfile:     /var/run/php/@processname@.pid
+# pidfile:     /var/run/@processname@.pid
 #
 
 # Source function library
 # Get network config
 . /etc/sysconfig/network
 
-pidfile=/var/run/php/@processname@.pid
+configfile=/etc/php/fpm.conf
 lockfile=/var/lock/subsys/@processname@
+pidfile=$(sed -ne  's,.*"\?pid_file"\?>\([^<]\+\)<.*,\1,p' $configfile)
+pidfile=${pidfile:-/var/run/@processname@.pid}
 
 start() {
        # Check if the service is already running?
@@ -28,7 +30,7 @@ start() {
        fi
 
        msg_starting "PHP FastCGI Process Manager (@processname@)"
-       daemon --pidfile $pidfile /usr/sbin/@processname@ --fpm --fpm-config /etc/php/fpm.conf
+       daemon --pidfile $pidfile /usr/sbin/@processname@ --fpm --fpm-config $configfile
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch $lockfile
 }
@@ -95,7 +97,7 @@ case "$1" in
        reload USR1 0
        ;;
   status)
-       status @processname@
+       status  --pidfile $pidfile @processname@
        RETVAL=$?
        ;;
   *)
This page took 0.030292 seconds and 4 git commands to generate.