I'm getting the following error in log/resque-0.log:
rake aborted!
non-absolute home
/srv/myapp/current/Rakefile:4
If I start a worker manually using the same command God uses, it starts up just fine:
QUEUE=* RAILS_ENV=production /usr/b开发者_运维问答in/rake -f /srv/myapp/current/Rakefile environment resque:work
I've tried running that command under the 'rails' user and the 'root' user (which God runs under). Any ideas?
you have an extra environment in yours between "Rakefile" and "resque"
My god scripts usually look like this:
rails_env = ENV['RAILS_ENV'] || "development"
rails_root = ENV['RAILS_ROOT'] || "/path/to/app"
God.watch do |w|
w.name = "resque-task"
w.group = 'resque'
w.interval = 30.seconds
w.start = "/path/to/rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"
w.uid = 'gazler'
w.gid = 'gazler'
So part of the problem is shadow_puppet trying to resolve your path, but if you're actually trying to use shadow_puppet or something else that tries to expand path on ~ (like Capistrano for example) make sure to include:
w.env = {"HOME" => "/users/home/dir"}
That fixed this problem for my situation (driving cap from a god-monitored resque worker).
Ok turns out I just had to remove shadow_puppet from my Gemfile. Not sure why I had it in there in the first place, maybe it was a holdover from an old version of Moonshine.
精彩评论