Skip to content
Browse files

Fix bug #64764: Add status option to fpm init.d script

  • Loading branch information...
1 parent 2a93fd1 commit ee01af7df149da2c511b0f91db2e161eebb2bf58 @kaplanlior kaplanlior committed with smalyshev May 16, 2013
Showing with 16 additions and 1 deletion.
  1. +1 −0 NEWS
  2. +15 −1 sapi/fpm/init.d.php-fpm.in
View
1 NEWS
@@ -18,6 +18,7 @@ PHP NEWS
- FPM:
. Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi)
+ . Implemented FR #64764 (add support for FPM init.d script). (Lior Kaplan)
- PDO:
. Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to
View
16 sapi/fpm/init.d.php-fpm.in
@@ -91,6 +91,20 @@ case "$1" in
fi
;;
+ status)
+ if [ ! -r $php_fpm_PID ] ; then
+ echo "php-fpm is stopped"
+ exit 0
+ fi
+
+ PID=`cat $php_fpm_PID`
+ if ps -p $PID | grep -q $PID; then
+ echo "php-fpm (pid $PID) is running..."
+ else
+ echo "php-fpm dead but pid file exists"
+ fi
+ ;;
+
force-quit)
echo -n "Terminating php-fpm "
@@ -131,7 +145,7 @@ case "$1" in
;;
*)
- echo "Usage: $0 {start|stop|force-quit|restart|reload}"
+ echo "Usage: $0 {start|stop|force-quit|restart|reload|status}"
exit 1
;;

0 comments on commit ee01af7

Please sign in to comment.
Something went wrong with that request. Please try again.