Sha256: dc8c2f006fc9b583862fb9162efd6db850ccdd4a76e3ec9ce3fea75eda50bcd3

Contents?: true

Size: 1.64 KB

Versions: 11

Compression:

Stored size: 1.64 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

11 entries across 11 versions & 1 rubygems

Version Path
rubber-2.15.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.14.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.13.1 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.13.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.12.2 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.12.1 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.12.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.11.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.10.2 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.10.1 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf
rubber-2.10.0 templates/monit/config/rubber/role/delayed_job/monit-delayed_job.conf