From owner-freebsd-current@FreeBSD.ORG Fri Jun 20 19:47:21 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B9C2737B401 for ; Fri, 20 Jun 2003 19:47:21 -0700 (PDT) Received: from area51.slashnet.org (area51.slashnet.org [209.150.101.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCD8543FA3 for ; Fri, 20 Jun 2003 19:47:20 -0700 (PDT) (envelope-from smkelly@zombie.org) Received: from edgemaster.zombie.org (ip68-13-71-251.om.om.cox.net [68.13.71.251]) by area51.slashnet.org (Postfix) with ESMTP id 9CB8F49F4E for ; Fri, 20 Jun 2003 22:47:19 -0400 (EDT) Received: by edgemaster.zombie.org (Postfix, from userid 1001) id C98A539839; Fri, 20 Jun 2003 21:47:07 -0500 (CDT) Date: Fri, 20 Jun 2003 21:47:07 -0500 From: Sean Kelly To: current@freebsd.org Message-ID: <20030621024707.GA73447@edgemaster.zombie.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: Software watchdog patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2003 02:47:22 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings. I've been working on a patch which adds software watchdog to the FreeBSD 5.1-CURRENT kernel. Below is an URL to the patch to my work, and I'd appreciate it if anybody interested in this venture would give me their feedback on what I've got and also help debug it. The patch is available here: http://www.sean-kelly.org/watchdog.diff My watchdog patch is two pieces. One half is a kernel patch which adds the watchdog timer checker to hardclock() in sys/kern/kern_clock.c. It also adds a watchdog_fire() function which performs various things on a watchdog timeout. The userland half of the patch adds a watchdogd daemon which periodically wakes up from a sleep to "notify" the kernel that the userland is still intact. This patch also adds a watchdogd(8) manpage, a watchdog(4) manpage, and an /etc/rc.d/watchdogd startup script. In order to utilize the watchdog, you must build a kernel with options WATCHDOG It is also advised that you enable watchdogd to /etc/rc.conf: watchdogd_enable=3D"YES" Three new sysctls are added: debug.watchdog.enabled When this is non-zero, the watchdog is active and hardclock() is verifying that the watchdog timer has not timed out. debug.watchdog.timeout: 20 This is the number of seconds the watchdog can go without a timer update. debug.watchdog.reset: 0 When this sysctl is "touched" (read/write), it resets the watchdog_ticks kernel variable to the value of ticks. When (ticks - watchdog_ticks) > watchdog.timeout seconds, the watchdog fires by calling watchdog_fire(). When the watchdog fires (watchdog_fire()), different things happen depending on the kernel configuration. First, interrupt counts are dumped to the console. Then, if your kernel was built with DDB support, you will get a backtrace and be dropped to the DDB prompt. If your kernel has no DDB support, your kernel will panic and presumably reboot itself. Note that I attempted to stick to style(9). If I did not, please point out my mistakes and I'll be happy to fix them. Also note that this is my first venture writing manpages from scratch, so feel free to tear them apart and mock me. However, I did read mdoc(7) and check them for warnings. I look forward to any feedback, whether positive or negative. --=20 Sean Kelly | PGP KeyID: D2E5E296 smkelly@zombie.org | http://www.zombie.org --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+88crPm7A9NLl4pYRAkdVAJ9ZL8vwij89UuK5233QyqSCmkIwhQCgsMQn IODnuk9OPrskuZSzJe/Cv8I= =m813 -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf--