diff --git a/roles/common/templates/monit.j2 b/roles/common/templates/monit.j2 index cbf68e884f..012e0ee4da 100644 --- a/roles/common/templates/monit.j2 +++ b/roles/common/templates/monit.j2 @@ -1,9 +1,9 @@ check process openfoodnetwork_dj_worker_0 with pidfile {{ current_path }}/tmp/pids/delayed_job.0.pid start program = "/bin/bash -c 'RAILS_ENV={{ rails_env }} {{ unicorn_home_path }}/.rbenv/shims/ruby {{ current_path }}/script/delayed_job -i 0 start'" -as uid {{ user }} and gid {{ user }} +as uid {{ unicorn_user }} and gid {{ unicorn_user }} with timeout 120 seconds stop program = "/bin/bash -c 'RAILS_ENV={{ rails_env }} {{ unicorn_home_path }}/.rbenv/shims/ruby {{ current_path }}/script/delayed_job -i 0 stop'" -as uid {{ user }} and gid {{ user }} +as uid {{ unicorn_user }} and gid {{ unicorn_user }} with timeout 120 seconds if mem is greater than 250.0 MB for 3 cycles then restart