Add a wdogctl startup/shutdown script.

This commit is contained in:
thorpej 2002-07-30 05:58:42 +00:00
parent 5fed6739d9
commit afbf483286
3 changed files with 51 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: rc.conf,v 1.40 2002/06/27 15:10:32 christos Exp $
# $NetBSD: rc.conf,v 1.41 2002/07/30 05:58:44 thorpej Exp $
#
# /etc/defaults/rc.conf --
# default configuration of /etc/rc.conf
@ -233,6 +233,9 @@ screenblank=NO screenblank_flags="" # wscons and FBIO screenblanker
moused=NO # serial mouse handler
moused_flags="-p /dev/tty00"
wdogctl=NO # watchdog timer control
# wdogctl_flags="-k devicename"
# Configuration of "wscons" console driver virtual screens.
#
wscons=NO wscons_flags="" # setup wscons from wscons.conf

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.31 2002/07/03 23:31:25 yamt Exp $
# $NetBSD: Makefile,v 1.32 2002/07/30 05:58:42 thorpej Exp $
.include <bsd.own.mk>
@ -19,7 +19,8 @@ FILES= DAEMON LOGIN NETWORKING SERVERS \
route6d routed rtadvd rtsold rwho \
savecore screenblank sendmail securelevel sshd \
swap1 swap2 sysdb sysctl syslogd \
timed ttys virecover wscons wsmoused xdm xfs ypbind yppasswdd ypserv
timed ttys virecover wdogctl wscons wsmoused xdm xfs \
ypbind yppasswdd ypserv
FILESDIR= /etc/rc.d
FILESMODE= ${BINMODE}

44
etc/rc.d/wdogctl Executable file
View File

@ -0,0 +1,44 @@
#!/bin/sh
#
# $NetBSD: wdogctl,v 1.1 2002/07/30 05:58:43 thorpej Exp $
#
# BEFORE: disks
# The watchdog is configured VERY early, so that any problems that
# occur during the bootstrap process are protected by the watchdog.
. /etc/rc.subr
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"