<% @path = '/etc/monit/monit.d/monit-resque_worker.conf' %> <% rubber_env.resque_workers.each_with_index do |worker, i| %> <% PIDFILE = "#{RUBBER_ROOT}/tmp/pids/resque_worker_#{i}.pid" start_program = "cd #{RUBBER_ROOT} && ./script/resque_worker_management.rb start #{i}" stop_program = "cd #{RUBBER_ROOT} && ./script/resque_worker_management.rb stop #{i}" %> check process resque_worker_<%= i %> with pidfile <%= PIDFILE %> group resque_worker start program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> bash -l -c '<%= start_program %>'" stop program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> bash -l -c '<%= stop_program %>'" if totalmem > 350.0 MB for 15 cycles then restart <% end %>