How to stop God from leaving stale Resque worker processes?

痴心易碎 提交于 2019-12-03 02:14:30

You need to tell god to use pid file generated by rescue and set pid file

w.env = {'PIDFILE' => '/path/to/resque.pid'}
w.pid_file = '/path/to/resque.pid'

env will tell rescue to write pid file, and pid_file will tell god to use it

also as svenfuchs noted it should be enough to set only proper env:

w.env = { 'PIDFILE' => "/home/travis/.god/pids/#{w.name}.pid" }

where /home/travis/.god/pids is the default pids directory

I might be a little late to the party here but we had the same issue on our side. We were using

rvm 2.1.0@ do bundle exec rake environment resque:work

which caused the multiple processes. According to our sysops guy this is due to the usage of rvm do which we ended up replacing with

/path/to/rvm/gems/ruby-2.1.0/wrappers/bundle exec rake environment resque:work

This allowed god to work as expected without the need to specify the pid file.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!