rubber/rubber — pull request #467 by johnnyshields (2014-04-21 03:28:56+00:00)
Title: Improvements for Delayed Job template

Improvements to Delayed Job template
1. Add `:kill` and `:status` tasks
2. Run DJ in bundle exec context (applies to both deploy-delayed_job.rb and monit-delayed_job.conf)
3. Move monit-delayed_job.conf inside the monit vulcanizer, as is the standard for all other templates
4. Remove `app_user` from executing delayed job and run as `root` instead to avoid permisison errors. It seems most processes triggered by Rubber run as `root`; even in cases where spawned workers have a different user, the original daemonizer process was run as `root`.
5. Add delayed job PID file control
6. Monit should have a 10-minute timeout (currently no timeout) because the PID file being monitored is not generated until after DJ daemonizes. (In this respect, DJ is different than most processes.) I chose 10 mins because my bulky app takes about 6 mins to daemonize. Once DJ daemonizes the timeout is cut short and Monit finishes.