在我的 /etc/monit/monitrc 中我有以下几行:
check process foo_server with pidfile /var/run/bwam_server.pid
start program = "/Users/foo/foo_server.sh start"
stop program = "/Users/foo/foo_server.sh stop"
check directory foo_data path "/Users/foo/Library/Application Support/foo_server/data"
if timestamp > 1 minute then alert
#if timestamp > 1 minute then restart foo_server
我知道我的主目录中不应该有这些东西,但除此之外:如果我取消注释最后一行,Monit 会告诉我syntax error on foo_server
——但据我所知,我正确地定义了这个过程——我还能如何引用它?
答案1
添加到/Users/foo/foo_server.sh 重启操作并更改配置:
if timestamp > 1 minute then alert
if timestamp > 1 minute then
exec "/Users/foo/foo_server.sh restart"