From owner-freebsd-current@FreeBSD.ORG Tue Dec 17 22:01:46 2013 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37C246D7 for ; Tue, 17 Dec 2013 22:01:46 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7FB181165 for ; Tue, 17 Dec 2013 22:01:45 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA27585; Wed, 18 Dec 2013 00:01:37 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Vt2ht-000Hla-14; Wed, 18 Dec 2013 00:01:37 +0200 Message-ID: <52B0C988.5010507@FreeBSD.org> Date: Wed, 18 Dec 2013 00:00:40 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Maksim Yevmenkin , "current@freebsd.org" Subject: Re: [rfc] [patch] do not stop watchdog on shutdown References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 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: Tue, 17 Dec 2013 22:01:46 -0000 on 17/12/2013 20:53 Maksim Yevmenkin said the following: > hello, > > would anyone object to this patch? > > max > > Index: src/etc/rc.d/watchdogd > =================================================================== > --- src/etc/rc.d/watchdogd (revision 2999) > +++ src/etc/rc.d/watchdogd (working copy) > @@ -39,4 +39,7 @@ > pidfile="/var/run/${name}.pid" > > load_rc_config $name > + > +sig_stop="${watchdogd_sig_stop:-TERM}" > + > run_rc_command "$1" I wonder if anyone could object to this rather generic (and NOP by default) change. I see your intent, but a few words about it would not hurt :-) BTW, for a while now we have some support for interacting with the watchdog(9) from within the kernel. I have the following local patch / hack that makes use of that support: commit b64c5e855420f2d905a04f69fad5de116e8ffae5 Author: Andriy Gapon Date: Fri Nov 25 10:00:59 2011 +0200 [test] arm the watchdog before going into the final shutdown/reboot step ... to preclude hanging on that step. Note: halt assumes the limbo, so no watchdog for that case. diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index eaa78b8e..88afaa9 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -444,6 +444,11 @@ kern_reboot(int howto) if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold && !dumping) doadump(TRUE); + if ((howto & RB_HALT) != 0) + wdog_kern_pat(0); + else + wdog_kern_pat(WD_TO_32SEC + 1); + /* Now that we're going to really halt the system... */ EVENTHANDLER_INVOKE(shutdown_final, howto); Admittedly, there is a gap between userland watchdog being stopped and kernel watchdog taking over. I wish that we had 'proper' integration between them, with proper hand-off, etc. -- Andriy Gapon