VPS侦探论坛
标题:
【军哥,再帮忙看看】502不重启php-fpm,求指点
[打印本页]
作者:
zuoqz
时间:
2013-9-8 20:41
标题:
【军哥,再帮忙看看】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日志:
Sep 8 19:27:01 AY12051912132121e8189 crond[3931]: (root) CMD (/root/502.sh)
Sep 8 19:28:01 AY12051912132121e8189 crond[3943]: (root) CMD (/root/502.sh)
Sep 8 19:29:01 AY12051912132121e8189 crond[3954]: (root) CMD (/root/502.sh)
Sep 8 19:30:01 AY12051912132121e8189 crond[3961]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Sep 8 19:30:01 AY12051912132121e8189 crond[3962]: (root) CMD (/root/502.sh)
Sep 8 19:31:01 AY12051912132121e8189 crond[3972]: (root) CMD (/root/502.sh)
Sep 8 19:32:01 AY12051912132121e8189 crond[4021]: (root) CMD (/root/502.sh)
但是显示502之后仍然不重启php-fpm,求指点!
[
本帖最后由 zuoqz 于 2013-9-13 06:16 编辑
]
作者:
zuoqz
时间:
2013-9-9 07:31
补充:直接在xshell中运行 /etc/init.d/php-fpm restart 就好使了
作者:
licess
时间:
2013-9-9 08:11
curl 装了没?
作者:
zuoqz
时间:
2013-9-9 08:21
标题:
回复 3# 的帖子
谢谢军哥:之前就已经装过了!
[root@AY12051912132121e8189 ~]# /etc/init.d/php-fpm restart
Shutting down php_fpm . done
Starting php_fpm done
[root@AY12051912132121e8189 ~]# 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
作者:
zuoqz
时间:
2013-9-9 09:25
版本是lnmp0.9,装了一年多了!
作者:
zuoqz
时间:
2013-9-13 06:17
顶上去,军哥看还需要什么日志?我传上来!
作者:
licess
时间:
2013-9-13 20:20
看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的当时重启的时间有错误没
欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/)
Powered by Discuz! X3.4