Skip to content

Auto Starting the server @ Boot

Scott edited this page Jun 3, 2021 · 4 revisions

OPTION 1: Create a Supervisor Config to start the GUI with Gunicorn (PREFERRED):

Add...

/home/pi/led-board-manager/supervisor-daemon.conf

...to the end of the files = line, under the[Include] section of your /etc/supervisor/supervisord.conf with just a space between the two paths. This will tell supervisor to use the updated program configurations that the webgui generates. To disable this feature, simply remove this line.

Example:
[include]
files = conf.d/*.conf /home/pi/led-board-manager/supervisor-daemon.conf

Then run command sudo supervisorctl reread

OPTION 2: Create a script and use rc.local to autostart the devserver on startup:

We're going to use the Raspberry Pi's /etc/rc.local file to start our script on boot. In the /led-board-manager folder, create a new file using:

Enter sudo nano /etc/rc.local to add the following line before exit 0:

su pi -c '/home/pi/led-board-manager/scripts/autorun.sh >> /tmp/scoreboard-gui.log 2>&1'

...substituting your own username for pi, if changed. This method will also create a log file for the server: /tmp/scoreboard-gui.log. You can tail the log with the following command:

tail -f -n 100 /tmp/scoreboard-gui.log

Alternatively, you can setup a crontab, systemd, or another method of your choice to autostart the app.

Clone this wiki locally