1 1.1 thorpej #!/bin/sh 2 1.1 thorpej # 3 1.2 mycroft # $NetBSD: wdogctl,v 1.2 2004/08/13 18:08:03 mycroft Exp $ 4 1.1 thorpej # 5 1.1 thorpej 6 1.1 thorpej # BEFORE: disks 7 1.1 thorpej 8 1.1 thorpej # The watchdog is configured VERY early, so that any problems that 9 1.1 thorpej # occur during the bootstrap process are protected by the watchdog. 10 1.1 thorpej 11 1.2 mycroft $_rc_subr_loaded . /etc/rc.subr 12 1.1 thorpej 13 1.1 thorpej name="wdogctl" 14 1.1 thorpej rcvar=$name 15 1.1 thorpej 16 1.1 thorpej start_cmd="watchdog_start" 17 1.1 thorpej stop_cmd="watchdog_stop" 18 1.1 thorpej status_cmd="watchdog_status" 19 1.1 thorpej 20 1.1 thorpej extra_commands="status" 21 1.1 thorpej 22 1.1 thorpej watchdog_start() 23 1.1 thorpej { 24 1.1 thorpej if [ x"${wdogctl_flags}" = "x" ]; then 25 1.1 thorpej warn "\${wdogctl_flags} is not set, watchdog not started" 26 1.1 thorpej else 27 1.1 thorpej echo "Starting watchdog timer." 28 1.1 thorpej /sbin/wdogctl ${wdogctl_flags} 29 1.1 thorpej fi 30 1.1 thorpej } 31 1.1 thorpej 32 1.1 thorpej watchdog_stop() 33 1.1 thorpej { 34 1.1 thorpej echo "Stopping watchdog timer." 35 1.1 thorpej /sbin/wdogctl -d 36 1.1 thorpej } 37 1.1 thorpej 38 1.1 thorpej watchdog_status() 39 1.1 thorpej { 40 1.1 thorpej /sbin/wdogctl 41 1.1 thorpej } 42 1.1 thorpej 43 1.1 thorpej load_rc_config $name 44 1.1 thorpej run_rc_command "$1" 45