Posts: 8
Joined: Wed Mar 28, 2018 4:04 pm

Program Reboot After Crash

Mon Jul 30, 2018 1:44 pm

Hi All,

I'm running a c program on a loop and I currently have it booting at startup from .bashrc. I want the program to run forever but the program has crashed on occasions. I know I need a watchdog feature but I'm unsure of how to do it on a RPi 3B+ in C. I found this tutorial...

https://bloggerbrothers.com/2016/12/20/ ... systemctl/

...which introduces the concept of calling systemd throughout your program as a kind of 'heart beat' to prove your program is still alive. However, being in python, I'm not too sure how it would translate to a C program.

Any help greatly appreciated, thanks.

User avatar
Posts: 10157
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Program Reboot After Crash

Mon Jul 30, 2018 2:20 pm

just create a systemd service file and run it via that
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV


Return to “C/C++”