针对 s10ops项目 来进行的重启

[root@ayibang-server scripts]# cat /home/liujianzuo/server/scripts/monitor_uwsgi 

fi
}
stop(){

kill `ps -ef |grep "s10ops/demo.ini"|awk '$3==1{print $0}'|awk '{print $2}'` 2>/dev/null
sleep 1
kill `ps -ef |grep "s10ops/demo.ini"|awk '$3==1{print $0}'|awk '{print $2}'` 2>/dev/null
sleep 1
kill `ps -ef |grep "s10ops/demo.ini"|awk '$3==1{print $0}'|awk '{print $2}'` 2>/dev/null
snum=`ps -ef |grep "/data/soft_ware/s10ops/demo.ini" |awk '{print $(NF-1),$NF}'|uniq|wc -l`
if [ $snum -eq 1 ];then
action "uwsgi project s10ops stop done..." /bin/true
else
action "pls by ur self stop s10ops project.." /bin/false
fi
}
restart(){
stop
echo " " >/home/liujianzuo/uwsgi_run.log 2>&1
start
}

menu=$1
case $menu in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
esac

 

加到定时任务 每隔三小时重启

[root@ayibang-server scripts]# cat /home/liujianzuo/server/scripts/cron_uwsgi
#!/bin/sh
/bin/sh /home/liujianzuo/server/scripts/monitor_uwsgi restart
[root@ayibang-server scripts]# crontab -l

# restart uwsgi
00 */3 * * * /bin/sh /home/liujianzuo/server/scripts/cron_uwsgi >/dev/null 2>&1

 

相关文章:

  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-11-11
  • 2021-08-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
相关资源
相似解决方案