Keep MudPi Running With Supervisord

While you can run MudPi manually it is recommended to run it in the background. Using a task monitor like supervisord is excellent to keep MudPi running in the background and only is a pip3 install supervisor away.

Please note if you installed MudPi using the installer then this has all be taken care of for you.

Configuring Supervisord

Using a tool like supervisor allows you to keep MudPi running in the event of errors or system restarts. This is what I do personally in all my setups.

Here is a example config file for supervisord once you get that installed. In my case this was located under /etc/supervisor/conf.d/ on most my linux installations. Change the paths and log files names as you need but keep in mind MudPi uses these suggested defaults in the UI so don't change them unless you know what you are doing.

[program:mudpi]
directory=/home/mudpi
command=mudpi --config core/mudpi/mudpi.config
autostart=true
autorestart=true
stderr_logfile=/home/mudpi/logs/error.log
stdout_logfile=/home/mudpi/logs/output.log

Controlling MudPi in the Background

You can then control your program through supervisor using the supervisorctl command. You will need to make note of the program:name you specificed in your supervisor config. In the example provided above the name is mudpi. You can then use the following commands to start, stop and restart your program through supervisor.

supervisorctl start mudpi
supervisorctl restart mudpi
supervisorctl stop mudpi

Start MudPi

To start MudPi through supervisor run

sudo supervisorctl start mudpi

Stop MudPi

To stop MudPi through supervisor run

sudo supervisorctl stop mudpi

Restart MudPi

To restart MudPi through supervisor run

sudo supervisorctl restart mudpi

Status of MudPi

To check the status of MudPi through supervisor run

sudo supervisorctl status mudpi
Getting Started with a Raspberry Pi from Scratch
Preparing the SD Card 4:02
Booting Up & Configuring Raspbian 4:48
SSH and SSH Keys (Video Coming Soon)
Updating Python on Raspbian & Installing Useful Packages (Video Coming Soon)