I've been using watchdog (http://linux.die.net/man/8/watchdog) to automatically reset my RPi if it gets stuck. It runs a daemon which monitors CPU load, free memory, network status and other things, and triggers a reboot if certain conditions are met.
Unfortunately there seems to be a problem with version 5.12 in the repositories. The ping function always fails, sending the RPi into an endless cycle of reboots. If you try it, be sure to disable the automatic restart of the watchdog daemon first:
- in /etc/default/watchdog set run_watchdog=0
- then run the watchdog manually with sudo /usr/sbin/watchdog -v and monitor the output with tail -f /var/log/daemon.log
The latest version (v5.13 available here: http://sourceforge.net/projects/watchdo ... t/download) doesn't seem to have this problem, although it needs to be compiled. Luckily it's not difficult, and there are instructions in the included INSTALL file. I've also made a deb, which you can find here: http://tgiles.icern.ch/binaries/watchdo ... _armhf.deb. Install in the usual way, with sudo dpkg -i watchdog_5.13-1_armhf.deb
Hope that's useful to somebody.