【发布时间】:2021-01-13 16:53:01
【问题描述】:
我们刚刚开始使用 monit 进行进程监控,并且在 monit 中使用了很多新功能。我在 /home/ubuntu/launch_example.sh 有一个 bash 脚本。这是连续运行的。是否可以使用 monit 进行监控?如果 bash 脚本终止,monit 应该启动脚本。应该是什么语法。我尝试了以下语法,但所有命令都没有以 ubuntu 用户身份执行,比如 shell 脚本调用了一些 python 脚本。
check process launch_example
matching "launch_example"
start program = "/bin/bash -c '/home/ubuntu/launch_example.sh'"
as uid ubuntu and gid ubuntu
stop program = "/bin/bash -c '/home/ubuntu/launch_example.sh'"
as uid ubuntu and gid ubuntu
【问题讨论】:
标签: monit