Skip to content

Instantly share code, notes, and snippets.

@Empact
Forked from johankok/delayed_job.monitrc.example
Created February 10, 2012 10:39
Show Gist options
  • Save Empact/1788684 to your computer and use it in GitHub Desktop.
Save Empact/1788684 to your computer and use it in GitHub Desktop.
Monitoring delayed_job with monit under rvm
# an example Monit configuration file for delayed_job
#
# To use:
# 1. copy to /var/www/apps/{app_name}/shared/delayed_job.monitrc
# 2. replace {app_name} and {environment} as appropriate
# 3. add this to your /etc/monit/monitrc
#
# include /var/www/apps/{app_name}/shared/delayed_job.monitrc
check process delayed_job with pidfile /var/www/apps/{app_name}/shared/pids/delayed_job.pid
start program = "/usr/bin/env RAILS_ENV={environment} /var/www/apps/{app_name}/current/script/delayed_job start"
stop program = "/usr/bin/env RAILS_ENV={environment} /var/www/apps/{app_name}/current/script/delayed_job stop"
# an example Monit configuration file for delayed_job
#
# To use:
# 1. copy to /var/www/apps/{app_name}/shared/delayed_job.monitrc
# 2. replace {app_name} and {environment} as appropriate
# 3. add this to your /etc/monit/monitrc
#
# include /var/www/apps/{app_name}/shared/delayed_job.monitrc
check process delayed_job with pidfile /var/www/apps/{app_name}/shared/pids/delayed_job.pid
start program = "/usr/bin/env RAILS_ENV={environment} PATH=$PATH:/usr/local/bin:/home/deploy/.rvm/rubies/ruby-1.9.2-p290/bin/ GEM_HOME=/home/deploy/.rvm/gems/ruby-1.9.2-p290 /var/www/apps/{app_name}/current/script/delayed_job start"
stop program = "/usr/bin/env RAILS_ENV={environment} PATH=$PATH:/usr/local/bin:/home/deploy/.rvm/rubies/ruby-1.9.2-p290/bin/ GEM_HOME=/home/deploy/.rvm/gems/ruby-1.9.2-p290 /var/www/apps/{app_name}/current/script/delayed_job stop"
@Empact
Copy link
Author

Empact commented Feb 10, 2012

Well github is choking on the /'s in the path for some reason, but the whole point, in RAILS_ROOTscriptdelayed_job.monitrc.example, is to show how to use delayed job with monit and rvm. A chore which has me contemplating the move to rbenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment