【军哥,再帮忙看看】502不重启php-fpm,求指点
自己本地建的502.sh上传到/root用的军哥给的:#!/bin/bash
# author: licess
# website: http://www.lnmp.org
CheckURL="http://www.ruantui.cn/index.php"
STATUS_CODE=`curl -o /dev/null -m 10 --connect-timeout 10 -s -w %{http_code} $CheckURL`
#echo "$CheckURL Status Code:\t$STATUS_CODE"
if [ "$STATUS_CODE" = "502" ]; then
/etc/init.d/php-fpm restart
fi
crontab日志:
Sep8 19:27:01 AY12051912132121e8189 crond: (root) CMD (/root/502.sh)
Sep8 19:28:01 AY12051912132121e8189 crond: (root) CMD (/root/502.sh)
Sep8 19:29:01 AY12051912132121e8189 crond: (root) CMD (/root/502.sh)
Sep8 19:30:01 AY12051912132121e8189 crond: (root) CMD (/usr/lib64/sa/sa1 1 1)
Sep8 19:30:01 AY12051912132121e8189 crond: (root) CMD (/root/502.sh)
Sep8 19:31:01 AY12051912132121e8189 crond: (root) CMD (/root/502.sh)
Sep8 19:32:01 AY12051912132121e8189 crond: (root) CMD (/root/502.sh)
但是显示502之后仍然不重启php-fpm,求指点!
[ 本帖最后由 zuoqz 于 2013-9-13 06:16 编辑 ] 补充:直接在xshell中运行 /etc/init.d/php-fpm restart 就好使了 curl 装了没?
回复 3# 的帖子
谢谢军哥:之前就已经装过了!# /etc/init.d/php-fpm restart
Shutting down php_fpm . done
Starting php_fpmdone
# yum install curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.grandcloud.cn
* extras: mirrors.grandcloud.cn
* updates: mirror.esocc.com
base | 1.1 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
Package curl-7.15.5-17.el5_9.x86_64 already installed and latest version
Package curl-7.15.5-17.el5_9.i386 already installed and latest version
Nothing to do 版本是lnmp0.9,装了一年多了! 顶上去,军哥看还需要什么日志?我传上来! 看crontab已经执行,你把脚本修改成这样
#!/bin/bash
# author: licess
# website: http://www.lnmp.org
CheckURL="http://www.ruantui.cn/index.php"
NowTime=`date`
STATUS_CODE=`curl -o /dev/null -m 10 --connect-timeout 10 -s -w %{http_code} $CheckURL`
#echo "$CheckURL Status Code:\t$STATUS_CODE"
if [ "$STATUS_CODE" = "502" ]; then
echo "$NowTime $CheckURL Status Code:\t$STATUS_CODE" >> /root/502log.log
/etc/init.d/php-fpm restart >> /root/502log.log
fi
这样看看/root/502log.log 里有重启的错误没
或看看php-fpm的当时重启的时间有错误没
页:
[1]