Hmmm... If the program crashes while it's set to run on boot, it will restart within less than a second. The only problem here is that if it crashes "too quickly", then systemd
, which manages the service, may decide that the service is faulty and therefore suspend it. I am not sure what "too quickly" means exactly, and whether that applies to your case, but the documentation for systemd
and/or systemctl
may provide more hints.
It seems that the above behaviour may be enough for your purposes, however here is some more:
adrianmcroft possible to stop a running program from a switch
This is possible. The Bela Button on the cape will stop the running program if it's pressed briefly (and potentially it will restart immediately). If it is held pressed for more than 2seconds, it will gracefully shutdown the board. Both behaviours are overridable and the button is remotable.