I use Python in industrial settings. A machine I have built sometimes has unforeseen issues. At times, the camera driver fails, at other times, the GPU driver appears to fail. The program interrupts and is readily available when I restart the program without further issues.
I would like to know if there is a way for me to monitor a bash or python program in a way, where it is relaunched the moment it stops. I already use a bash script to execute the program and I also have it setup with cron’s on-boot autostart.
I use Ubuntu 22.04 LTS, Python 3.12. The camera manufacturer is Balluff (using the mvImpact library) and the GPU is from Nvidia (Pytorch with CUDA).
In essence, I would like to have an automatic launcher. Does anyone have a hint what best practices there are to accomplish this?