Tonight littl' recipe: configuring a resque worker to be monitored via god
Here are the steps roughly:
- install god (sudo gem install god)
- sudo mkdir /etc/god then put the modified master.conf into /etc/god and try god out to see if everything works fine
- make god reboot ready
- sudo cp god-service /etc/init.d
- sudo chmod +x /etc/init.d/god-service
- sudo update-rc god-service defaults
- try out your init.d script by calling /etc/init.d/god-service start|stop|status
- prepare your app resque.god configuration
- add the god part to your config/deploy.rb
You may want to tweak the deploy.rb to match more closely the expected behaviour.
Also (as suggested earlier on the resque librelist) you can tweak the configuration using ERB to create n workers instead of one here.