From vivek@kcilink.com  Wed Oct  4 14:24:24 2006
Return-Path: <vivek@kcilink.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 21FC816A5B6
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Oct 2006 14:24:24 +0000 (UTC)
	(envelope-from vivek@kcilink.com)
Received: from lorax.kcilink.com (lorax.kciLink.com [206.112.95.1])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AF06143D70
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Oct 2006 14:24:13 +0000 (GMT)
	(envelope-from vivek@kcilink.com)
Received: from localhost (localhost [127.0.0.1])
	by lorax.kcilink.com (Postfix) with ESMTP id 5E2C5118DF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Oct 2006 10:24:12 -0400 (EDT)
Received: from lorax.kcilink.com ([127.0.0.1])
	by localhost (lorax.kcilink.com [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id DHjxTx6s4qvl for <FreeBSD-gnats-submit@freebsd.org>;
	Wed,  4 Oct 2006 10:24:11 -0400 (EDT)
Received: from bluefish.kcilink.com (bluefish-prv.kcilink.com [192.168.100.56])
	by lorax.kcilink.com (Postfix) with SMTP id 1111311524
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Oct 2006 10:24:11 -0400 (EDT)
Received: (nullmailer pid 10354 invoked by uid 120);
	Wed, 04 Oct 2006 14:24:11 -0000
Message-Id: <1159971851.050906.8099.nullmailer@bluefish.kcilink.com>
Date: Wed, 04 Oct 2006 10:24:11 -0400
From: Vivek Khera <vivek@khera.org>
Reply-To: Vivek Khera <vivek@khera.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: rc.d/named restart failure
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         103976
>Category:       conf
>Synopsis:       rc.d/named restart failure
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 04 14:30:17 GMT 2006
>Closed-Date:    Sun Oct 28 00:34:36 UTC 2007
>Last-Modified:  Sun Oct 28 00:34:36 UTC 2007
>Originator:     Vivek Khera
>Release:        FreeBSD 6.1-RELEASE-p10 amd64
>Organization:
>Environment:
System: FreeBSD bluefish.kcilink.com 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #3: Tue Oct 3 10:49:29 EDT 2006 vivek@redfish.kcilink.com:/n/lorax1/usr6/obj.amd64/n/lorax1/usr6/src/sys/KCI64SMP amd64


	
>Description:
	

/etc/r.cd/named restart doesn't wait for named to exit before attempting to
start the new process.

>How-To-Repeat:
	

[root@bluefish]# /etc/rc.d/named restart
Stopping named.
named already running? (pid=40998).
[root@bluefish]# /etc/rc.d/named restart
Stopping named: rndc failed, trying killall: No matching processes were found
wrote key file "/var/named/etc/namedb/rndc.key"
Starting named.
[root@bluefish]# uname -a
FreeBSD bluefish.kcilink.com 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #3: Tue Oct  3 10:49:29 EDT 2006     vivek@redfish.kcilink.com:/n/lorax1/usr6/obj.amd64/n/lorax1/usr6/src/sys/KCI64SMP  amd64
[root@bluefish]# 


>Fix:

	

make the rc.d script wait for the process to die first?
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Oct 4 15:14:46 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103976 

From: Rudy Rucker <crapsh@monkeybrains.net>
To: bug-followup@FreeBSD.org, vivek@khera.org
Cc:  
Subject: [patch] Re: conf/103976: rc.d/named restart failure
Date: Thu, 19 Jul 2007 01:46:23 -0700

 --- named.orig  Thu Jul 19 01:35:41 2007
 +++ named       Thu Jul 19 01:46:44 2007
 @@ -96,6 +96,15 @@
                         echo .
                 fi
         fi
 +       if killall -0 named 2> /dev/null; then
 +               echo -n "Waiting... "
 +               sleep 1
 +       fi
 +       if killall -0 named 2> /dev/null; then
 +               if killall named 2> /dev/null; then
 +                       echo -n ". "
 +               fi
 +       fi
  }
 
State-Changed-From-To: open->feedback 
State-Changed-By: dougb 
State-Changed-When: Thu Jul 19 09:32:53 UTC 2007 
State-Changed-Why:  

I'm a little confused by this PR, since in your example 
the 'killall' doesn't find a running process, so I don't 
understand what problem you're trying to solve. 

Are you saying that with the output that you pasted there 
IS still a named running, and then the 'start' fails for 
that reason? 


Responsible-Changed-From-To: freebsd-rc->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Thu Jul 19 09:32:53 UTC 2007 
Responsible-Changed-Why:  

I generally handle this script 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103976 
State-Changed-From-To: feedback->patched 
State-Changed-By: dougb 
State-Changed-When: Mon Oct 22 09:51:14 UTC 2007 
State-Changed-Why:  

I just committed version 1.27 of rc.d/named which has a 
fix for this issue. Please try it and let me know if it 
works for you. 

Doug 


http://www.freebsd.org/cgi/query-pr.cgi?pr=103976 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/103976: commit references a PR
Date: Mon, 22 Oct 2007 14:26:00 +0000 (UTC)

 dougb       2007-10-22 09:38:44 UTC
 
   FreeBSD src repository
 
   Modified files:
     etc/rc.d             named 
   Log:
   1. Determine the location of the rndc* binaries relative to $command
   so that when using named from the ports (or elsewhere) the proper rndc*
   commands will be run.
   
   2. Rework the stop routine using ideas from brooks and delphij.
   Specifically I am duplicating a lot of code from rc.subr's stop routine
   so that this one will behave more like the one in rc.subr, but use rndc
   to kill the daemon (or regular kill if that fails). This also avoids
   the problems related to using killall if rndc fails, which is bad if
   you're running more than one named on the same box.
   
   3. Take a concept from gshapiro and allow the rndc.key file to be
   owned by root OR the named_uid user.
   
   Although I used different solutions, this commit handles issues raised in:
   PR:     conf/73929
   PR:     conf/103976
   PR:     conf/109409
   
   Revision  Changes    Path
   1.27      +22 -14    src/etc/rc.d/named
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: dougb 
State-Changed-When: Sun Oct 28 00:34:01 UTC 2007 
State-Changed-Why:  

The patch has now been MFC'ed. 

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