Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion sapi/fpm/init.d.php-fpm.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ case "$1" in
fi
;;

status)
if [ ! -r $php_fpm_PID ] ; then
echo "php-fpm is stopped"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"not running" would be better

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"not running" would be better than "dead"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

fi
;;

force-quit)
echo -n "Terminating php-fpm "

Expand Down Expand Up @@ -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
;;

Expand Down