例如开机自启动nginx

编写一个脚本

#vi /usr/local/Monitor_nginx.sh

#!/bin/bash

if [ "$(ps -ef | grep "nginx: master process"| grep -v grep )" == "" ]

then

/usr/local/nginx/sbin/nginx

fi

#chmod u+x /usr/local/Monitor_nginx.sh

#vi /etc/rc.local

sh /usr/local/Monitor_nginx.sh

 

相关文章:

  • 2021-04-15
  • 2021-12-20
  • 2022-12-23
  • 2022-01-19
  • 2021-09-11
猜你喜欢
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-08-07
相关资源
相似解决方案