supervisord - hang on to your processes
Translation of the original in Catalan. Read it in: CatalàCastellano

I have always been a great defender of
as a complement to the Linux service control system: rc.d scripts. Monit allows, through a web management interface, controlling and delegating to users without Linux knowledge the basic control of the services of a machine. In order to supervise whether a service is running it relies on the PID of the process and its existence, which to be honest in many cases is a bit poor. But it has a great capacity to configure actions based on memory loads, CPU, etc.
is software that to a certain extent gives us an integrated solution and a much more efficient one in some aspects than monit+rc.d, for example, the monitoring of the processes is much more effective than with monit because these are launched as children of supervisord. That allows the parent to be able to check whether the child is really alive or not. Besides, when a child dies the parent quickly knows it and can restart it if that is what we want. Whereas monit to do that does a
polling
process every x seconds asking for the state of the processes.
Monit has a web interface and control via the system CLI, just like supervisord. Although monit shows some information about the system load that supervisord is not capable of showing. On the other hand supervisord, by launching the processes itself natively, allows redirecting the outputs of these (stdout, stderr, etc).
Apart from these small advantages of monit over supervisord that I have mentioned so far, for the rest of the things we could say that supervisord runs rings around monit, starting with the concept. So then, from now on in the article I will focus on explaining the features it has without comparing them:
- http server management of the processes via web
- supervisorctl management via CLI, it is an interactive management interface not the system CLI itself.
- program it allows parameterising the launching and control of a service with working directory, umask, priority, autostart, autorestart, retries, user, redirection of the standard and error outputs to configuration files, environment variables, etc.
- group the services can be grouped in order to treat them as a unit.
- fcgi interface it allows controlling groups of services launched via FastCGI. Avoiding that this task is done by, for example, Apache and offering a much more efficient concurrency management.
- events a set of events is defined from which we can define a series of scripts to capture them and give them a controlled treatment. For example, the state of a process changes and we want that when that happens the same process is restarted.
- rpcinterface it also has an XML-RPC interface through which we can connect third-party applications. For example, an application can connect via RPC to know whether a service is working.
Soon I have to do the migration of some systems, so then, if there is no news I will use supervisord to control HAProxy, keepalived, among many other tools. I hope to be able to document it little by little.