使用 Monit 监控 Resque

使用 Monit 监控 Resque

我正在尝试使用 resque 作为 Rails 的作业运行器。我尝试过此配置,以及许多其他妖魔化救援任务的方法(因为运行 rake resque:work 会使终端与该命令绑定)。不幸的是,他们的示例配置对我来说不起作用。配置看起来正确吗?或者还有其他方法可以将进程变成守护进程吗?谢谢 :)

check process resque_worker_QUEUE
  with pidfile /data/APP_NAME/current/tmp/pids/resque_worker_QUEUE.pid
  start program = "/bin/sh -c 'cd /data/APP_NAME/current; RAILS_ENV=production QUEUE=queue_name VERBOSE=1 nohup rake environment resque:work& > log/resque_worker_QUEUE.log && echo $! > tmp/pids/resque_worker_QUEUE.pid'" as uid deploy and gid deploy
  stop program = "/bin/sh -c 'cd /data/APP_NAME/current && kill -s QUIT `cat tmp/pids/resque_worker_QUEUE.pid` && rm -f tmp/pids/resque_worker_QUEUE.pid; exit 0;'"
  if totalmem is greater than 300 MB for 10 cycles then restart  # eating up memory?

答案1

如果你想将它作为守护进程运行,请查看导师. 大多数发行版都直接从其软件包存储库发送它。

相关内容