I have monit configuration like this:
check process unicorn with pidfile /tmp/pids/unicorn.0.pid start program = "/etc/init.d/unicorn start" stop program = "/etc/init.d/unicorn stop" restart program = "/etc/init.d/unicorn reload" if mem is greater than 250.0 MB for 2 cycles then restart if cpu is greater than 22% for 3 cycles then alert if cpu is greater than 25% for 2 cycles then restart
But look like whenever monit tries to reload the app (e.g due to memory > 250MB), it issues a stop and then a start, rather than use the restart program. Is there a way to tell monit to run the restart instead? Since issue a stop and a start cause the website to goes down for some moment.