Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/etc Add a wdogctl startup/shutdown script.
details: https://anonhg.NetBSD.org/src/rev/257b4b1d6440
branches: trunk
changeset: 534588:257b4b1d6440
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Jul 30 05:58:42 2002 +0000
description:
Add a wdogctl startup/shutdown script.
diffstat:
etc/defaults/rc.conf | 5 ++++-
etc/rc.d/Makefile | 5 +++--
etc/rc.d/wdogctl | 44 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 3 deletions(-)
diffs (86 lines):
diff -r cfac22919816 -r 257b4b1d6440 etc/defaults/rc.conf
--- a/etc/defaults/rc.conf Tue Jul 30 04:45:41 2002 +0000
+++ b/etc/defaults/rc.conf Tue Jul 30 05:58:42 2002 +0000
@@ -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 @@
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
diff -r cfac22919816 -r 257b4b1d6440 etc/rc.d/Makefile
--- a/etc/rc.d/Makefile Tue Jul 30 04:45:41 2002 +0000
+++ b/etc/rc.d/Makefile Tue Jul 30 05:58:42 2002 +0000
@@ -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 @@
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}
diff -r cfac22919816 -r 257b4b1d6440 etc/rc.d/wdogctl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/rc.d/wdogctl Tue Jul 30 05:58:42 2002 +0000
@@ -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"
Home |
Main Index |
Thread Index |
Old Index