LONGJA
Posts: 7
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
RaTTuS
Posts: 10061
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
like
viewtopic.php?f=29&t=7192&start=25#p898424
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 9 guests