Sha256: 3ef62992f82240c41bb8cb1009957f50d2f4a874ae0e37ded60176257f531768

Contents?: true

Size: 1.65 KB

Versions: 9

Compression:

Stored size: 1.65 KB

Contents

<%
  @path = '/etc/monit/monit.d/monit-delayed_job.conf'
  current_path = "/mnt/#{rubber_env.app_name}-#{Rubber.env}/current"

  bin_path = "bin/delayed_job"
  script_path = "script/delayed_job"
  script_path = File.exists?(bin_path) ? bin_path : script_path
%>

<% if rubber_env.num_delayed_job_workers == 1 %>
check process delayed_job
  with pidfile <%= rubber_env.delayed_job_pid_dir %>/delayed_job.pid
  start program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> /bin/bash -l -c 'cd <%= current_path %> && RAILS_ENV=<%= Rubber.env %> bundle exec <%= script_path %> start --pid-dir=<%= rubber_env.delayed_job_pid_dir %>'" with timeout 600 seconds
  stop program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> /bin/bash -l -c 'cd <%= current_path %> && RAILS_ENV=<%= Rubber.env %> bundle exec <%= script_path %> stop --pid-dir=<%= rubber_env.delayed_job_pid_dir %>'" with timeout 600 seconds
<% else %>
<% rubber_env.num_delayed_job_workers.times do |id| %>
check process delayed_job_<%= id %>
  with pidfile <%= rubber_env.delayed_job_pid_dir %>/delayed_job.<%= id %>.pid
  start program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> /bin/bash -l -c 'cd <%= current_path %> && RAILS_ENV=<%= Rubber.env %> bundle exec <%= script_path %> start -i <%= id %> --pid-dir=<%= rubber_env.delayed_job_pid_dir %>'" with timeout 600 seconds
  stop program = "/usr/bin/sudo -H -u <%= rubber_env.app_user %> /bin/bash -l -c 'cd <%= current_path %> && RAILS_ENV=<%= Rubber.env %> bundle exec <%= script_path %> stop -i <%= id %> --pid-dir=<%= rubber_env.delayed_job_pid_dir %>'" with timeout 600 seconds
  group delayed_job
<% end %>
<% end %>
  if 5 restarts within 5 cycles then timeout

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubber-3.2.2 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-3.2.1 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-3.2.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-3.1.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-3.0.1 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-3.0.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.16.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.15.2 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.15.1 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf