[packages/php: 1/2] get pidfile path from config
glen
glen at pld-linux.org
Sun Aug 26 21:44:54 CEST 2012
commit d60d17359b2fd9229d5350cac6cd3d90b62ef2b3
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Aug 26 14:46:15 2012 +0300
get pidfile path from config
Conflicts:
php-fpm.init
Conflicts:
php-fpm.init
php-fpm.init | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/php-fpm.init b/php-fpm.init
index 9ce2b56..142250e 100644
--- a/php-fpm.init
+++ b/php-fpm.init
@@ -17,8 +17,10 @@
# Get network config
. /etc/sysconfig/network
-pidfile=/var/run/php/php-fpm.pid
-lockfile=/var/lock/subsys/php-fpm
+configfile=/etc/php/php-fpm.conf
+lockfile=/var/lock/subsys/@processname@
+pidfile=$(sed -ne 's,^pid\s*=\s*\(.*\),\1,p' $configfile)
+pidfile=${pidfile:-/var/run/php/@processname at .pid}
start() {
# Check if the service is already running?
@@ -27,8 +29,8 @@ start() {
return
fi
- msg_starting "PHP FastCGI Process Manager"
- daemon --pidfile $pidfile /usr/sbin/php-fpm --fpm-config /etc/php/php-fpm.conf
+ msg_starting "PHP FastCGI Process Manager (@processname@)"
+ daemon --pidfile $pidfile /usr/sbin/@processname@ --fpm-config $configfile
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $lockfile
}
@@ -95,7 +97,7 @@ case "$1" in
reload USR1 0
;;
status)
- status php-fpm
+ status --pidfile $pidfile @processname@
RETVAL=$?
;;
*)
More information about the pld-cvs-commit
mailing list