]> git.pld-linux.org Git - packages/php.git/commitdiff
get pidfile path from config
authorElan Ruusamäe <glen@delfi.ee>
Sun, 26 Aug 2012 11:46:15 +0000 (14:46 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 26 Aug 2012 11:46:15 +0000 (14:46 +0300)
php-fpm.init

index 5da5db06e4d88b4d291e77f6d944b62f42fe66a8..3006f7e2a6f11100560b4d6387dd7fc5ced69769 100644 (file)
 # 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/php/@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.054283 seconds and 4 git commands to generate.