Skip to content

Commit ee01af7

Browse files
kaplanliorsmalyshev
authored andcommitted
Fix bug #64764: Add status option to fpm init.d script
1 parent 2a93fd1 commit ee01af7

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PHP NEWS
1818

1919
- FPM:
2020
. Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi)
21+
. Implemented FR #64764 (add support for FPM init.d script). (Lior Kaplan)
2122

2223
- PDO:
2324
. Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to

sapi/fpm/init.d.php-fpm.in

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ case "$1" in
9191
fi
9292
;;
9393

94+
status)
95+
if [ ! -r $php_fpm_PID ] ; then
96+
echo "php-fpm is stopped"
97+
exit 0
98+
fi
99+
100+
PID=`cat $php_fpm_PID`
101+
if ps -p $PID | grep -q $PID; then
102+
echo "php-fpm (pid $PID) is running..."
103+
else
104+
echo "php-fpm dead but pid file exists"
105+
fi
106+
;;
107+
94108
force-quit)
95109
echo -n "Terminating php-fpm "
96110

@@ -131,7 +145,7 @@ case "$1" in
131145
;;
132146

133147
*)
134-
echo "Usage: $0 {start|stop|force-quit|restart|reload}"
148+
echo "Usage: $0 {start|stop|force-quit|restart|reload|status}"
135149
exit 1
136150
;;
137151

0 commit comments

Comments
 (0)