Sha256: e6c8eea6739a9372a544ce13b509d700a72440a88812665aebaaa72da59eb55d

Contents?: true

Size: 1.21 KB

Versions: 24

Compression:

Stored size: 1.21 KB

Contents

<%
  @path = '/etc/monit/monit.d/monit-mongrel.conf'
%>

<% (0..(rubber_env.mongrel_count.to_i - 1)).each do |i| %>

  <% port = rubber_env.mongrel_base_port + i %>
  <% pidfile = "#{Rubber.root}/tmp/pids/mongrel.#{port}.pid" %>
  check process mongrel-<%= port %> with pidfile <%= pidfile %>
    group mongrel-<%= Rubber.env %>
    start program = "/bin/sh -c 'cd <%= Rubber.root %> && PATH=<%= rubber_env.ruby_prefix %>/bin:/usr/local/bin:$PATH && mongrel_rails cluster::start --clean --only <%= port %>'"
    <%
    # Stop gracefully - monit waits for stop to complete (since below process exits immediately, it must
    # wait for pid to disappear) before trying to start
    %>
    stop program = "/bin/sh -c 'cd <%= Rubber.root %> && PATH=<%= rubber_env.ruby_prefix %>/bin:/usr/local/bin:$PATH && mongrel_rails cluster::stop --clean --only <%= port %> && sleep 30 && mongrel_rails cluster::stop --clean --force --only <%= port %>'"
    if totalmem > 200.0 MB for 3 cycles then restart
    <%# monit needs to test on same same interface that mongrel is listening on (see mongrel_cluster.yml) %>
    if failed host <%= rubber_env.host %> port <%= port %> protocol http with timeout 10 seconds for 10 cycles then restart
<% end %>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rubber-2.1.2 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.1.1 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.1.0 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.8 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.7 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.6 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.5 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.4 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.3 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.2 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.1 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre12 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre11 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre10 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre9 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre8 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre7 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre6 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf
rubber-2.0.0.pre5 templates/monit/config/rubber/role/mongrel/monit-mongrel.conf