Pi Awesome

Reference and guides to build kick ass raspberry pi projects.

View the Project on GitHub codingforentrepreneurs/Pi-Awesome

Supervisor as a Background Service Manager

Supervisor, often called supervisord, is a simple way to manage processes that you need your pi to run. In our case, we’re using it to run a minimal python web application (flask).

1. Install

sudo apt install supervisor -y

2. Start Supervisor

sudo service supervisor start

3. Create a Supervisor Process

Be sure to enable the correct permissions on the user or the user’s group so the below process can actually run.

All of your custom processes will live in the following directory:


Create file project.supervisor.conf and put:

command=/home/pi/app/bin/gunicorn wsgi:app

4. Update Supervisor

sudo supervisorctl reread
sudo supervisorctl update

These two commands will let supervisor know of our new process (reread) and it will run it (update).

5. Verify Commands

sudo supervisorctl status flaskapp
sudo supervisorctl start flaskapp
sudo supervisorctl stop flaskapp
sudo supervisorctl restart flaskapp

6. Check logs

In our project.supervisor.conf from Step 3, we have the following log paths:




These logs are useful to uncover errors with your application running.