php-fpm容易假死,实现自动重启php服务~

作者: cayman 分类: 编程技术 发布时间: 2016-10-14 01:13

#!/bin/bash
#check php-fpm server up/down
TelLog=/tmp/telphp.log
while :
do
sleep 15;
/usr/bin/telnet 127.0.0.1 9000 << ! > $TelLog
quit
!
SOK=`cat $TelLog | grep "Escape character" |wc -l`
if [ $SOK -eq 1 ];then
echo "php-fpm is ok"
else
/usr/local/webserver/php/sbin/php-fpm restart
fi
done

运行

</pre>
nohup sh /root/php-fpmrw.sh > /dev/null 2>&1 &

<pre>

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注