Two aims:
1) Make sure background daemons such as webserver/rabbitmq are running all the time. If they crash they are automatically restarted etc. For this I am using monit with a config like:
set httpd port PORTNUM and
use address localhost
allow localhost
check process WEBSERVER with pidfile /var/run/WEBSERVER.pid
start program = "/etc/init.d/WEBSERVER start"
stop program = "/etc/init.d/WEBSERVER stop"
2) Run 'n' number of python processes simultaneously. For running these, supervisord is being used, with a config like:
[program:name]
command= somecommand
numprocs=3
process_name=%(process_num)s
Questions:
1. Could there be any issues with this approach? Or is it a bad idea in general ?
2. Is there a way to avoid this situation?
AFAIK supervisord needs everything to run in foreground and Monit cannot run multiple number of a script.
This will be 'dockerized' (In case that matters).
Thanks