Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)
Can anybody tell me the way to handle the software watchdog in Linux?

I have a program SampleApplication which runs continuously and that I got to restart it if its hangs or closes unexpectedly.

I was Googling about this and located Linux has watchdog at /dev/watchdog but don’t skills to use it. Could someone help me with an example?

My question is where to specify my application name and delay interval to restart?

1 Answer

0 votes
by (36.8k points)
edited by

Most of my Unix/Linux init programs will manage the daemons for you and restart them. Look into placing your service in /etc/inittab. Or you might be using Upstart or systemd.

All of those programs run as PID 1 and it's their job to watch and restart system processes.

From your Busybox tag, I might assume you're running an embedded system. On those, the System V style init scripts with all of their shell scripts are overkill. Probably rip all that out and replace it with a entries in /etc/inittab or upstart the systemd jobs.

To know about Linux join the Linux training

Related questions

0 votes
1 answer
asked Nov 28, 2020 in Linux by blackindya (18.4k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...