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

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@kaplanlior

No description provided.

@Majkl578 Majkl578 commented on the diff May 16, 2013
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"
@Majkl578
Majkl578 May 16, 2013

"not running" would be better

@Majkl578 Majkl578 commented on the diff May 16, 2013
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"
@Majkl578
Majkl578 May 16, 2013

"not running" would be better than "dead"

@kaplanlior
kaplanlior May 16, 2013

The phrases were taken from RHEL/Centos lsb messages to be aligned with other daemons.

@php-pulls
Collaborator

Comment on behalf of stas at php.net:

merged

@php-pulls php-pulls closed this Jun 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment