Harnessing the magical power of Supervisord

Right, so I deployed a certain Python application on my EC2 instance.
I had a problem at that time : I’ll have to keep the pipe of the console which I am using to run the application alive, else the application would drop dead.
To solve this, I used supervisor. Supervisor is a program that allows you to monitor an app’s status.
In short, it allows me to keep the Python application alive, even if it killed itself at some point. It also mean that I don’t have to ssh to the instance and start the application manually ! Neat, no ?

Long story short, I jammed the command I used to start the app from Command Line, and added some extra modification to the application.
There was an issue with starting the application from Supervisor : it messed the relative directory locations. The app needs config which it imports using relative path. It seems that when supervisor starts the app, the directory supervisor is running the app from is not the directory of the script itself.

After tinkering abit with the app, it was good and still running until today !

Leave a Reply

Your email address will not be published. Required fields are marked *