C++的程序的守护脚本,记录所有的进程pid,守护脚本
##############################################################
#MPS
##############################################################
MPSpid=$(pgrep -l MPS | awk '{print $1}')
MPSarray=($MPSpid)
MPS(){
mpspath=${bashdir}mps/bin
echo $MPSpid
#array length lt 1 重新给数组赋值
if [ ${#MPSarray[@]} -lt 1 ];then
MPSpid=$(pgrep -l MPS | awk '{print $1}')
MPSarray=($MPSpid)
echo $MPSpid
fi
for i in ${MPSarray[*]}
do
NUM=$(ps -ef |grep $i | grep -v "grep" | awk '{print $2}' | wc -l)
if [ $NUM -lt 1 ];then
cd $mpspath && /bin/bash stop.sh >/dev/null 2>&1
cd $mpspath && /bin/bash start.sh >/dev/null 2>&1
if [ $? -eq 0 ];then
echo "started"
MPSarray=()
else
echo " not started success"
fi
fi
done
}
提供面试指导、模拟面试、简历项目优化和职业规划等
负责SRE团队,运维架构(DevOps)、微服务流量治理(K8s、Ingress)、稳定性和可测性系统建设(Prometheus、EFK、Loki)

浙公网安备 33010602011771号