由于CentOS 6的启动由system v的init改成Upstart,所以monit的启动也做相应的修改。
- vi /etc/init/monit.conf
- # monit
- start on stopped rc RUNLEVEL=[2345]
- respawn
- exec /usr/local/monit/bin/monit -Ic /etc/monitrc
start on stopped rc RUNLEVEL=[2345]
在运行级别2345服务停止,自动重启
respawn
进程结束后自动重启
exec /usr/local/monit/bin/monit -Ic /etc/monitrc
启动时执行的命令
转载于:https://blog.51cto.com/linuxjcq/718231