NSLU2-Linux
view · edit · print · history

Openslug can support a watchdog timer to reboot your slug

Here is what I did to get it working on OpenSlug 3.1

ipkg install kernel-module-ixp4xx-wdt
insmod /lib/modules/2.6.16/kernel/drivers/char/watchdog/ixp4xx_wdt.ko
echo ixp4xx_wdt >> /etc/modutils/ixp4xx_wdt
update-modules

You should now have a device /dev/watchdog

Busybox supports a Watchdog command with the following Syntax. I had to recompile the standard busybox that comes with OpenSlug to add the watchdog command. You can check which commands you busybox supports with busybox --help

watchdog [-t <seconds>] [-F] DEV

Periodically write to watchdog device DEV . Options:

-t Timer period in seconds - default is 30
-F Stay in the foreground and don't fork"

Here's a startup script for /etc/init.d

 
#! /bin/sh 
#
# Copy it to /etc/init.d/watchdog and type
# > update-rc.d watchdog defaults 99
#
watchdog=/sbin/watchdog

test -x "$watchdog" || exit 0

case "$1" in
  start)
    echo  "Starting Watchdog"
    $watchdog /dev/watchdog
    ;;
  stop)
    ;;
  reload|force-reload)
    ;;
  restart)
    ;;
  *)
    echo "Usage: /etc/init.d/watchdog {start|stop|reload|restart|force-reload}"
    exit 1
esac

view · edit · print · history · Last edited by mhornsby.
Originally by mhornsby.
Page last modified on November 03, 2007, at 10:37 AM