Hi guys I've got a script that defines some event triggered functions. I would like it to always be running in the background.
I'm thinking of putting an infinite loop (While(True):
Pass)
at the end and running it on startup (running it on bootlocal.sh).
Will this work? And is there any better way?
Thanks in advance!
Solved: Run Pythom Script as a daemon
Last edited by Zizico2 on Wed Nov 21, 2018 11:09 am, edited 1 time in total.
Re: Run Pythom Script as a daemon
afaik there are 2 prefered methods you could use (google)
1) systemd https://www.raspberrypi.org/documentati ... systemd.md
and
2) rc.local https://www.raspberrypi.org/documentati ... c-local.md
1) systemd https://www.raspberrypi.org/documentati ... systemd.md
and
2) rc.local https://www.raspberrypi.org/documentati ... c-local.md
Re: Run Pythom Script as a daemon
Will this work without a loop at the end? Won't the script just end?PhatFil wrote: ↑Wed Nov 21, 2018 4:22 amafaik there are 2 prefered methods you could use (google)
1) systemd https://www.raspberrypi.org/documentati ... systemd.md
and
2) rc.local https://www.raspberrypi.org/documentati ... c-local.md
Re: Run Pythom Script as a daemon
yes you will need an endless loop to encapsulate the monitoring code