【发布时间】:2012-09-26 04:48:14
【问题描述】:
我之前使用以下 Monit 脚本进行了 Monit 监控
check process resque_worker_production_QUEUE
with pidfile /var/tmp/resque_production.pid
start program = "/usr/bin/env HOME=/home/eg RACK_ENV=production PATH=/usr/local/bin:/usr/local/ruby/bin:/usr/bin:/bin:$PATH /bin/sh -l -c 'cd /apps/eg/production/current; nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE=mailer VERBOSE=1 PIDFILE=/var/tmp/resque_production.pid & >> log/resque_worker_production_QUEUE.log 2>&1'" as uid eg and gid eg
stop program = "/bin/sh -c 'cd /apps/eg/production/current && kill -9 $(cat
然后我改变了一些东西,最明显的是删除了系统范围的 rvm 安装,我假设在 /usr/local/ruby/bin 安装了 ruby。大约在这个时候,monit 无法再启动 resque。也许原因是其他原因,但我认为是这些卸载导致了损坏。
所以我查看了脚本并注意到 /usr/local/ruby/bin 不存在,所以我尝试将其更改为我认为应该指向的内容,因为我的 rvm 中的 ruby 是唯一的/home/eg/.rvm/rubies/ruby-1.9.3-p194/bin
但这没有用。所以我google了一些,发现这个建议也没有用:
check process resque_worker_production_QUEUE
with pidfile /var/tmp/resque_production.pid
start program = "/bin/bash -l -c 'cd /apps/eg/production/current; nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE=mailer VERBOSE=1 PIDFILE=/var/tmp/resque_production.pid & >> log/resque_worker_production_QUEUE.log 2>&1'" as uid eg and gid eg
我在日志中得到的只是:
[UTC Oct 5 03:06:38] error : 'resque_worker_production_QUEUE' process is not running
[UTC Oct 5 03:06:38] info : 'resque_worker_production_QUEUE' trying to restart
[UTC Oct 5 03:06:38] info : 'resque_worker_production_QUEUE' start: /bin/bash
[UTC Oct 5 03:07:08] error : 'resque_worker_production_QUEUE' failed to start
所以我不确定如何进一步调试。有什么建议吗?
【问题讨论】:
-
您的监控日志中有什么?您应该在那里查看确切的问题。
标签: ruby-on-rails ruby ubuntu resque monit