Let's say I start a delayed job worker pool with script/delayed_job --pool=high_priority,default --pool=* start
command and monitor it with monit:
check process delayed_job.0 with pidfile /var/www/project/shared/tmp/pids/delayed_job.0.pid
start program = "/usr/bin/env RAILS_ENV=production /var/www/project/current/script/delayed_job --pool=high_priority,default --pool=* start"
stop program = "/usr/bin/env RAILS_ENV=production /var/www/project/current/script/delayed_job --pool=high_priority,default --pool=* stop
check process delayed_job.1 with pidfile /var/www/project/shared/tmp/pids/delayed_job.1.pid
start program = "/usr/bin/env RAILS_ENV=production /var/www/project/current/script/delayed_job --pool=high_priority,default --pool=* start"
stop program = "/usr/bin/env RAILS_ENV=production /var/www/project/current/script/delayed_job --pool=high_priority,default --pool=* stop
This appears to be a safe configuration regarding starting workers which crashed.
But let's say someone invokes monit stop delayed_job.0
and it will also result in stopping delayed_job.1
. How can I safely stop only one of those processes and keep the other running?