From jonny@jonny.eng.br  Sat Aug 25 15:49:39 2007
Return-Path: <jonny@jonny.eng.br>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6242616A41A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 25 Aug 2007 15:49:39 +0000 (UTC)
	(envelope-from jonny@jonny.eng.br)
Received: from coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65])
	by mx1.freebsd.org (Postfix) with ESMTP id 12DCC13C46C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 25 Aug 2007 15:49:39 +0000 (UTC)
	(envelope-from jonny@jonny.eng.br)
Received: from localhost (localhost [127.0.0.1])
	by coe.ufrj.br (Postfix) with ESMTP id 53481125705
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 25 Aug 2007 12:27:16 -0300 (BRT)
Received: from coe.ufrj.br ([146.164.53.65])
	by localhost (roma.coe.ufrj.br [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id KurQcBi-C89I for <FreeBSD-gnats-submit@freebsd.org>;
	Sat, 25 Aug 2007 12:27:12 -0300 (BRT)
Received: by coe.ufrj.br (Postfix, from userid 2000)
	id 607711256FA; Sat, 25 Aug 2007 12:27:12 -0300 (BRT)
Message-Id: <20070825152712.607711256FA@coe.ufrj.br>
Date: Sat, 25 Aug 2007 12:27:12 -0300 (BRT)
From: Joo Carlos Mendes Lus <jonny@jonny.eng.br>
Reply-To: Joo Carlos Mendes Lus <jonny@jonny.eng.br>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: /etc/rc.d/named restart fails sometimes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         115814
>Category:       bin
>Synopsis:       /etc/rc.d/named restart fails sometimes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 25 15:50:01 GMT 2007
>Closed-Date:    Wed Jan 16 17:34:43 UTC 2008
>Last-Modified:  Wed Jan 16 17:34:43 UTC 2008
>Originator:     Joo Carlos Mendes Lus
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Barradev Tecnologia Ltda.
>Environment:
System: FreeBSD 6.2-STABLE Wed Jun 13 14:32:29 BRT 2007, i386

chrooted named
master for a few domains, slave for a few others, recursive for a small network

>Description:


# /etc/rc.d/named restart
Stopping named.
named already running? (pid=48587).
# /etc/rc.d/named restart
Stopping named: rndc failed, trying killall: No matching processes were found
Starting named.
# /etc/rc.d/named restart
Stopping named.
Starting named.
# /etc/rc.d/named restart
Stopping named.
Starting named.

>How-To-Repeat:

As seen above, just after restart the problem goes away.

Probably a delay when dying and many info still in memory.

>Fix:

I am no expert in rc-subr, but the fix is to make sure named has died before exiting the stop subroutine.

I usually do some kill -0 to check if a pid is still alive.

IMHO, every program that is stopped with kill(2) should have that kind of check.
Maybe this could be a new routine to rc.subr.

>Release-Note:
>Audit-Trail:

From: Florian Smeets <flo@kasimir.com>
To: bug-followup@FreeBSD.org, jonny@jonny.eng.br
Cc:  
Subject: Re: bin/115814: /etc/rc.d/named restart fails sometimes
Date: Wed, 16 Jan 2008 17:42:07 +0100

 Hi,
 
 my experience is that this has been fixed with Rev. 1.27 of 
 /etc/rc.d/named and has been MFCed to RELENG_6 as Rev. 1.22.2.3
 
 I think this PR can be closed.
 
 Cheers,
 Florian
 
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Wed Jan 16 17:34:41 UTC 2008 
State-Changed-Why:  
Florian reports that this had been resolved : "My experience is that 
this has been fixed with Rev. 1.27 of /etc/rc.d/named and has been MFCed 
to RELENG_6 as Rev. 1.22.2.3" 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115814 
>Unformatted:
