我对monit相当新,我想知道这个脚本是否足以重启崩溃的程序让我们说program1是程序的名称.
check process program1 matching "program1" start program = "/home/user/files/start.sh" stop program = "/home/user/files/stop.sh"
它现在会重启一个崩溃的程序吗?我怎样才能保证它在工作时不重启程序?
编辑:
更多信息
该程序使用端口30000 udp.这会让它更加谨慎吗? “周期”之间有多少秒?
if failed port 30000 type UDP for 3 cycles then restart
解决方法
Monit uses the system call execv to execute a program or a script.
This means that you cannot write shell commands directly in the start,
stop or exec statements. To do this,you must do as above; start a
shell and issue your commands there.
这只是您应该执行程序或脚本的示例:
check process program1 matching "program1" start program = "/bin/bash -c '/home/user/files/start.sh'" stop program = "/bin/bash -c '/home/user/files/stop.sh'"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。