您的位置:首页 > 运维架构 > Nginx

nginx和keepalive共存亡

2015-10-30 19:16 691 查看
加入nginx宕了,keepalive也跟着自杀
#!/bin/bash
while :
do
nginxpid=`ps -C nginx --no-header |wc -l`
if [ $nginxpid -eq 0 ];then
/etc/init.d/nginx restart
sleep 5
nginxpid=`ps -C nginx --no-header |wc -l`
if [ $nginxpid -eq 0 ];then
/etc/init.d/keepalived stop
fi
fi
sleep 5
done
本文出自 “杜海强” 博客,请务必保留此出处http://dulinux.blog.51cto.com/10803129/1708180
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: