1 Star 0 Fork 21

孙苏皖/keepalived

forked from src-openEuler/keepalived 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
keepalived-start-post.sh 807 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
umask 0027
echo "exec started post "
CheckPidFile()
{
ps -ef | grep "/usr/sbin/keepalived -D --all" | while read line;
do
PID=$(echo $line | awk '{print $2}')
FATHER=$(echo $line | awk '{print $3}')
CMD=$(echo $line| awk '{print $8}')
if [ $CMD = "/usr/sbin/keepalived" ] && [ $FATHER = "1" ]; then
echo $PID > /run/keepalived.pid
fi
done
}
if [ -f /run/keepalived.pid ]; then
echo $(/usr/bin/cat /run/keepalived.pid) > /run/keepalived.pid.save
else
CheckPidFile
fi
if [ -f /run/checkers.pid ]; then
echo $(/usr/bin/cat /run/checkers.pid) >> /run/keepalived.pid.save
else
echo 0 >> /run/keepalived.pid.save
fi
if [ -f /run/vrrp.pid ]; then
echo $(/usr/bin/cat /run/vrrp.pid) >> /run/keepalived.pid.save
else
echo 0 >> /run/keepalived.pid.save
fi
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sunsuwan/keepalived.git
git@gitee.com:sunsuwan/keepalived.git
sunsuwan
keepalived
keepalived
master

搜索帮助