加入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
时间: 2024-09-30 17:04:52