[packages/php/PHP_5_2] get pidfile path from config
glen
glen at pld-linux.org
Sun Aug 26 13:47:13 CEST 2012
commit bfee7dc5f005122a5356337a70e3f513ebbd0012
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Aug 26 14:46:15 2012 +0300
get pidfile path from config
php-fpm.init | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/php-fpm.init b/php-fpm.init
index 5da5db0..3006f7e 100644
--- a/php-fpm.init
+++ b/php-fpm.init
@@ -17,8 +17,10 @@
# Get network config
. /etc/sysconfig/network
-pidfile=/var/run/php/@processname at .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 at .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=$?
;;
*)
More information about the pld-cvs-commit
mailing list