Ruby on rails Monit未启动进程-执行失败错误
我正在使用monitgem监视我的sidekiq进程 我的Monitrc配置文件:-Ruby on rails Monit未启动进程-执行失败错误,ruby-on-rails,ruby,monitoring,sidekiq,monit,Ruby On Rails,Ruby,Monitoring,Sidekiq,Monit,我正在使用monitgem监视我的sidekiq进程 我的Monitrc配置文件:- check process sidekiq_process with pidfile /home/path_to_pid start program = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development" with timeout 60 seconds stop program = "bundle
check process sidekiq_process with pidfile /home/path_to_pid
start program = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development" with timeout 60 seconds
stop program = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development"
My sidekiq.yml文件:-
development:
:pidfile: tmp/pids/sidekiq_development.pid
:logfile: log/sidekiq_development.log
:concurrency: 1
在使用bundle exec sidekiq-d-L log/sidekiq.log-C config/sidekiq.yml-e development运行sidekiq后,然后运行sudo monit
,sudo monit status
给出以下信息:-
Process 'sidekiq_process'
status Running
monitoring status Monitored
pid 10951
parent pid 1378
uid 1000
effective uid 1000
gid 1000
uptime 0m
threads 2
children 0
memory 103.4 MB
memory total 103.4 MB
memory percent 1.3%
memory percent total 1.3%
cpu percent 0.0%
cpu percent total 0.0%
data collected Mon, 13 Aug 2018 12:14:06
因此,它的监控很好,当我终止sidekiq进程时,它甚至向我发送邮件“不存在”,但问题是在sidekiq进程终止后,它还应该重新启动进程。这是sidekiq被杀后,sudo monit status
给我的信息
Process 'sidekiq_process'
status Execution failed
monitoring status Monitored
data collected Mon, 13 Aug 2018 12:19:13
我还收到一封邮件,上面写着“执行失败”。
为什么我收到执行失败错误,为什么monit没有重新启动进程?将exec命令包装在一个shell脚本中,chmod+x它,并检查我的答案当进程被终止时,您能否确认文件中的pid是否被删除tmp/pids/sidekiq_development.pid
?不,文件未被删除,它仍然包含pid(在本例中为-10951),尽管我收到邮件“monit alert-不存在服务sidekiq_进程”,但我自己没有使用monit,您能看一下吗?我决定改用eye gem