0

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

gyaani_guy
  • 171
  • 1
  • 1
  • 8

1 Answers1

0

I don't foreseen any problem with this, even more if supervisord is managing another pool of tool than monit (a.k.a they don't overlap)

Monitoring supervisord with Monit could be a good idea to ensure its is always up.

As you state, monit is not able to handle several same process in a vanilla way.

Declaring several monit service and/or use of custom scripts are required.

DevOps
  • 720
  • 3
  • 15