from: https://www.bayerschmidt.com/raspberry-pi/89-auto-reboot-a-hung-raspberry-pi-using-the-on-board-watchdog-timer.html

Load the bcm2708_wdog kernel module:

sudo modprobe bcm2708_wdog

Configure to load on boot:

Append line to /etc/modules

echo "bcm2708_wdog" | sudo tee -a /etc/modules

Install watchdog software

sudo apt-get install watchdog

Start service at boot:

sudo update-rc.d watchdog defaults

Configure the watchdog daemon - edit /etc/watchdog.conf

sudo nano /etc/watchdog.conf

Uncomment the line that starts with #watchdog-device by removing the hash (#) to enable the watchdog daemon to use the watchdog device.
Uncomment the line that says #max-load-1 = 24 by removing the hash symbol to reboot the device if the load goes over 24 over 1 minute. A load of 25 of one minute means that you would have needed 25 Raspberry Pis to complete that task in 1 minute. You may tweak this value to your liking.

Start watchdog daemon:

sudo /etc/init.d/watchdog start

Watchdog is running.