recommended watchdog usage

Ronny Nilsson rln-nard at
Wed Mar 18 04:46:35 CET 2015

I'm guessing you want to restart your application if it crashes(?). Is it a 
daemon which forks to background or does it run in the foreground? In the 
later case a simple shell script like this should do the work:

until /opt/my-app; do
	sleep 1

This script in turn should be executed from within /etc/rc.<product> with:
start-stop-daemon -bSx /opt/ -p /var/run/ -m

Note that such a simple script restart your application only in the event it 
has terminated. It won't detect freezes or lockups. It can however be added 
by for example monitoring for the existence of a file in /tmp which you 
regularly re-create in your application.


> I'm just familiarizing myself with NARD, but I'd like to make use the
> watchdog to restart my app. There seems to be a dearth of information out
> there about how to use it, but this page seems helpful:
> I tried running the /sbin/watchdog command in the foreground, just as a
> test, but it didn't seem to work:
> root at skeleton-c7640e49:/mnt/sdcard/user> watchdog -F /dev/watchdog
> watchdog: can't open '/dev/watchdog': Device or resource busy
> Does this look like the correct invocation?
> Many thanks, this SDK is pretty awesome so far.
> Best,
> James

More information about the Nard mailing list