So supervisor helps you keep small apps running and makes it easy to monitor via a web interface. So it’s perfect for keeping like a slack bot up or other small python script running on an instance.
You can monitor console output without having to log in and restart if you want to.
To setup a app on supervisor just need add config file to supervisors conf directory.(use my template below)
The main config file for supervisor is in /etc/supervisor/supervisord.conf
Ive added the following to the config. its enables the cool web console on port 9001.
Which is nice dashboard for monitoring.
Would recommend running this behind firewall for securty reasons and change password.
Then lastly you can include configs in the conf.d directory.
This enable to just add .conf files to that folder and it will start the apps.
You can place multiple apps in a config file. To load run load command above or restart service.
As you can see if application terminates the app will be restarted.
Other modifications is I specified home directory for application will run in it own directory. Usefull if app uses config files or save info locally.
Lastly Startsec adds delay on start.With this you can stagger the startup of all apps so does cause load spikes starting up.
You can now monitor your application via on localhost:9001
Check supervisors main page for more details
supervisor main page
The platform is also highly extensible