lib/generators/initial/templates/capistrano/shared/monit.erb in teleporter-0.0.15 vs lib/generators/initial/templates/capistrano/shared/monit.erb in teleporter-0.0.16

- old
+ new

@@ -1,22 +1,7 @@ -<% application = fetch(:application) %> -set mail-format { subject: <%= "#{fetch(:full_app_name)} - #{fetch(:rails_env)}" %> $SERVICE $EVENT at $DATE } - -check process unicorn - with pidfile <%= current_path %>/tmp/pids/unicorn.pid - start program = "/etc/init.d/unicorn_<%= application %>_<%= fetch(:rails_env)%> start" - stop program = "/etc/init.d/unicorn_<%= application %>_<%= fetch(:rails_env)%> stop" - if mem is greater than 300.0 MB for 1 cycles then restart # eating up memory? - if cpu is greater than 50% for 2 cycles then alert # send an email to admin - if cpu is greater than 80% for 30 cycles then restart # hung process? - group unicorn - -<% (0..(fetch(:unicorn_worker_count) -1)).each do |worker| %> - check process unicorn_worker_<%= (5000 + worker).to_s %> - with pidfile <%= current_path %>/tmp/pids/unicorn.<%= (5000 + worker).to_s %>.pid - start program = "/bin/true" - stop program = "/etc/init.d/unicorn_<%= application %>_<%= fetch(:rails_env)%> kill_worker <%= (5000 + worker).to_s %>" - if mem is greater than 350.0 MB for 1 cycles then restart - if cpu is greater than 80% for 30 cycles then restart - - group unicorn_workers -<% end %> +# Monit configuration for Puma +# Service name: <%= puma_monit_service_name %> +# +check process <%= puma_monit_service_name %> + with pidfile "<%= fetch(:puma_pid) %>" + start program = "/usr/bin/sudo -u <%= fetch(:deploy_user) %> /bin/bash -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:bundle] %> exec puma -C <%= fetch(:puma_conf) %> --daemon'" + stop program = "/usr/bin/sudo -u <%= fetch(:deploy_user) %> /bin/bash -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:bundle] %> exec pumactl -S <%= fetch(:puma_state) %> stop'"