Closed spiderkeys closed 1 year ago
This may sound like a strange use-case, but I'm curious to know whether or not there is any reason why one couldn't or shouldn't run a second instance of supervisord as a child process of an upper level supervisord instance.
I've tested it out in a very basic manner, and haven't seen any issues, but was wondering if there are any core assumptions built into supervisord, when it comes to running multiple instances on a single machine, that could be being violated here.
The two supervisord
instances may not share any files or sockets, which you have done. The child supervisord
may not daemonize, which you have also done.
In [program:supervisord]
, set stopwaitsecs
to a value higher than the highest stopwaitsecs
value in all sections of the child supervisord
's configuration. If the child supervisord
does not exit before startwaitsecs
, the parent supervisord
will SIGKILL
it, in which case the child's subprocesses will be orphaned.
I have run multiple supervisord
instances on a single machine and it works. Although I've never tried running supervisord
as a child of another supervisord
, I can't think of any reasons why it would not work.
Thanks for the feedback - great point on the stopwaitsecs config!
This may sound like a strange use-case, but I'm curious to know whether or not there is any reason why one couldn't or shouldn't run a second instance of supervisord as a child process of an upper level supervisord instance.
I've tested it out in a very basic manner, and haven't seen any issues, but was wondering if there are any core assumptions built into supervisord, when it comes to running multiple instances on a single machine, that could be being violated here.
My example conf files:
Top-level supervisord.conf
Child supervisor
Using supervisorctl I can see the proper output from each example app under each supervisor:
For some specific context around what I'm trying to achieve here:
The child supervisord.conf is one that is expected to change often (manually by a user, so prone to error), and I am trying to come up with a quick method of isolating the parent instance and its direct child processes from misconfigurations in this child supervisord instance. By using an immutable configuration running in the parent instance, I expect that the parent instance will always be able to run (in the sense that it always has a valid supervisord.conf file which never changes). If someone introduces a typo in the child configuration which causes the child instance to exit altogether after a reread/reload, the parent instance should continue to run (only the child supervisord program will exit). The user could then fix whatever configuration error was made in the child conf and restart the child instance.