monit会重启delayed_job

时间:2010-06-22 16:51:52

标签: ruby-on-rails ruby delayed-job monit

如果我的delayed_job服务器坏了,那么monit会自动重启delayed_job服务器吗?

1 个答案:

答案 0 :(得分:2)

你必须告诉monit这样做...我使用以下配置:

check process delayed_job with pidfile /srv/rails/restorm_com/current/tmp/pids/delayed_job.pid
  start program = "/bin/su -c 'RAILS_ENV=production /srv/rails/restorm_com/current/script/delayed_job start' rails"
  stop program  = "/bin/su -c 'RAILS_ENV=production /srv/rails/restorm_com/current/script/delayed_job stop' rails"

  if cpu > 80% for 3 cycles then alert
  if loadavg(5min) greater than 2 for 3 cycles then alert