2002-07-30 09:58:42 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2009-04-21 20:08:57 +04:00
|
|
|
# $NetBSD: wdogctl,v 1.4 2009/04/21 16:08:57 joerg Exp $
|
2002-07-30 09:58:42 +04:00
|
|
|
#
|
|
|
|
|
2009-04-16 01:33:57 +04:00
|
|
|
# PROVIDE: wdogctl
|
2009-04-21 20:08:57 +04:00
|
|
|
# BEFORE: fsck_root
|
2002-07-30 09:58:42 +04:00
|
|
|
|
|
|
|
# The watchdog is configured VERY early, so that any problems that
|
|
|
|
# occur during the bootstrap process are protected by the watchdog.
|
|
|
|
|
2004-08-13 22:08:03 +04:00
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
2002-07-30 09:58:42 +04:00
|
|
|
|
|
|
|
name="wdogctl"
|
|
|
|
rcvar=$name
|
|
|
|
|
|
|
|
start_cmd="watchdog_start"
|
|
|
|
stop_cmd="watchdog_stop"
|
|
|
|
status_cmd="watchdog_status"
|
|
|
|
|
|
|
|
extra_commands="status"
|
|
|
|
|
|
|
|
watchdog_start()
|
|
|
|
{
|
|
|
|
if [ x"${wdogctl_flags}" = "x" ]; then
|
|
|
|
warn "\${wdogctl_flags} is not set, watchdog not started"
|
|
|
|
else
|
|
|
|
echo "Starting watchdog timer."
|
|
|
|
/sbin/wdogctl ${wdogctl_flags}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
watchdog_stop()
|
|
|
|
{
|
|
|
|
echo "Stopping watchdog timer."
|
|
|
|
/sbin/wdogctl -d
|
|
|
|
}
|
|
|
|
|
|
|
|
watchdog_status()
|
|
|
|
{
|
|
|
|
/sbin/wdogctl
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|