VPS侦探论坛

 找回密码
 注册
查看: 6344|回复: 6

【军哥,再帮忙看看】502不重启php-fpm,求指点

[复制链接]
发表于 2013-9-8 20:41:23 | 显示全部楼层 |阅读模式

自己本地建的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 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-9-9 07:31:42 | 显示全部楼层


补充:直接在xshell中运行 /etc/init.d/php-fpm restart 就好使了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-9-9 08:11:49 | 显示全部楼层

curl 装了没?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-9-9 08:21:52 | 显示全部楼层

回复 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
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-9-9 09:25:23 | 显示全部楼层

版本是lnmp0.9,装了一年多了!

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2013-9-13 06:17:24 | 显示全部楼层

顶上去,军哥看还需要什么日志?我传上来!
发表于 2013-9-13 20:20:47 | 显示全部楼层

看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推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 01:16 , Processed in 0.027685 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表