Skip to content

Instantly share code, notes, and snippets.

@samgranieri
Created July 19, 2012 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samgranieri/3145109 to your computer and use it in GitHub Desktop.
Save samgranieri/3145109 to your computer and use it in GitHub Desktop.
resque pool and the limited path it generates
/var/www/app_name/shared/bundle/ruby/1.9.1/bin
/home/rails/.rvm/gems/ruby-1.9.3-p194@app_name/bin
/home/rails/.rvm/gems/ruby-1.9.3-p194@global/bin
/home/rails/.rvm/rubies/ruby-1.9.3-p194/bin
/home/rails/.rvm/bin
/bin
/usr/bin
/sbin
/usr/sbin
<% pid_path = "#{shared_path}/pids/resque_pool.pid" -%>
<% rvm_preamble = "/usr/bin/env rvm_path=/home/#{runner}/.rvm /home/#{runner}/.rvm/bin/rvm-shell -c" -%>
<% log_path = "#{shared_path}/log/resque_pool.log" -%>
<% monit_runner = "as uid #{runner} and gid #{runner_group}" -%>
<% timeout = 'with timeout 90 seconds' -%>
<% start_command = "bundle exec resque-pool -E #{stage} -p #{pid_path} -o #{log_path} -e #{log_path} -d" -%>
<% stop_command = "cat #{pid_path} | xargs kill -QUIT && rm -f #{pid_path}; exit 0;" -%>
check process resque_pool
with pidfile <%= pid_path %>
start program = "<%= rvm_preamble %> 'cd <%= current_path %> && <%=start_command %>'" <%= monit_runner %> <%= timeout %>
stop program = "<%= rvm_preamble %> 'cd <%= current_path %> && <%=stop_command %>'" <%= monit_runner %> <%= timeout %>
if totalmem is greater than 450 MB for 10 cycles then restart
group resque
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment