php-fpm容易假死,实现自动重启php服务~
#!/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>