Добавьте следующие файлы .monitrc, как указано ниже, и выполните команду monit reload
для загрузки конфигурации.
/ и т.д. / монит / web.monitrc
check process apache with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if cpu > 80% for 5 cycles then restart
if totalmem > 300.0 MB for 5 cycles then restart
if children > 250 then alert
if failed port 80 with timeout 10 seconds then restart
if 3 restarts within 5 cycles then timeout
mode manual
group web
/ и т.д. / монит / delayed_job.monitrc
check process delayed_job with pidfile /mnt/<project>/tmp/pids/delayed_job.pid
start program = "/usr/bin/delayed_job_start"
stop program = "/usr/bin/delayed_job_stop"
mode manual
group delayed_job
/ USR / бен / delayed_job_start
#!/bin/sh
cd /mnt/<project> && RAILS_ENV=production ruby script/delayed_job start