Sha256: 1a51a9f2d9338d05f19824d57420b31368505ee934f4dbf7154a44e52b8476ea
Contents?: true
Size: 1.21 KB
Versions: 68
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
68 entries across 40 versions & 6 rubygems