Sensor Supervision
Recall how back in Supervisor, we installed the Supervisor utility. The time has come to put that daemon application to good use. While you certainly can just launch the watersensor.py script from a Terminal window, as soon as you close that window, the script will stop. If you recall the rclone script in Rclone, one way to prevent that from occurring is to add an ampersand character, &, to the end of the command:
python watersensor.py &
This ampersand instructs the BASH shell to run the script in the background and to keep it running even if the Terminal window originating the script’s execution is closed. While the script may continue to run in the background this way, there’s no guarantee that it will continue to run. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access