Sha256: 4e4c99bf3fbfbde6e07bbc920489d544fd7a3d65089d853c1c28a2503b869e08

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# Monit configuration for THIN :  <%= fetch(:application) %>  (<%= fetch(:stage) %>)
<%  fetch(:app_instances, 1).times do |n| %>
  check process <%= fetch(:application) %>_<%= fetch(:stage) %>_thin_<%= n %> with pidfile <%= deploy_to %>/shared/pids/thin_<%= fetch(:application) %>_<%= fetch(:stage) %>.<%= n %>.pid
    group thin-<%= fetch(:application) %>
    group thin-<%= fetch(:stage) %>
    start program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> ;<% if fetch(:monit_thin_with_secret) %> export SECRET_KEY_BASE=<%= fetch(:secrets_key_base) %>; export <%= fetch(:secrets_key_name) %>=<%= fetch(:secrets_key_base) %>;<% end %> bundle exec thin start -C config/thin_app_<%= fetch(:stage) %>.yml -o <%= n %>' "
    stop program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> ; bundle exec thin stop -C config/thin_app_<%= fetch(:stage) %>.yml -o <%= n %>' " 
    if does not exist then alert
    if mem > 200.0 MB for 1 cycles then restart
    if cpu > 50% for 3 cycles then restart
    if 5 restarts within 5 cycles then timeout
    # alert <%= fetch(:monit_mail_to) %> only on { pid }
    if changed pid 2 times within 20 cycles then alert
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
magic_recipes_two-0.0.35 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.34 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.33 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb