Quickstart `supervisor` guide
supervisor is a UNIX utility to managing and respawning long running Python processes to ensure they are always running. Or according to its website:
Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.
Installation
supervisor can be installed with pip
Given a script test_proc.py, start the process under supervisor as
Now it will run forever and you can see the process running with
You can stop the process with
Logs, by default, are written to /var/log/supervisor
The supervisor configuration can be found at /etc/supervisor/supervisor.conf
Configurations can be added to the supervisor.conf file for specific apps. Below we specify a configuration for the test_proc process, using a rotating file logger with two backups for both stdout amd stderr and a max file size of 100KBs.
After the script runs for a while, the output logs will look something like this:
More configurations for supervisor can be found here.
Discussion in the ATmosphere