I’m using a Raspberry Pi to collect data from a couple sensors and then send the data to an API. I have a python script that sets up a couple GPIO pins, collects the data, and makes the http requests.
I needed the python script to run when the Raspberry Pi started up.
Great post about running a python script at boot
Debian wiki on LSBInitScripts
Post on the difference between –exec and –startas with start-stop-daemon
Checking internet connection in python
Running code before exit in python