From nobody@FreeBSD.org  Mon Feb 12 18:02:42 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 582C037B4EC
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Feb 2001 18:02:42 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f1D22gb89367;
	Mon, 12 Feb 2001 18:02:42 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200102130202.f1D22gb89367@freefall.freebsd.org>
Date: Mon, 12 Feb 2001 18:02:42 -0800 (PST)
From: richard@gohome.net
To: freebsd-gnats-submit@FreeBSD.org
Subject: named.restart does not use named_flags from rc.conf
X-Send-Pr-Version: www-1.0

>Number:         25049
>Category:       misc
>Synopsis:       named.restart does not use named_flags from rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 12 18:10:01 PST 2001
>Closed-Date:    Tue Apr 10 19:13:03 PDT 2001
>Last-Modified:  Sun Apr 15 09:50:01 PDT 2001
>Originator:     Richard Roderick
>Release:        4.2
>Organization:
>Environment:
FreeBSD dns.pdx.uspops.com 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386
>Description:
named.restart does not maintain the named_flags, particularly when named is started via rc when rc.conf contains named_enable="YES"
>How-To-Repeat:

>Fix:
modify named.restart to include rc.conf and append ${named_flags} to the exec ndc restart line. Sample patch included.

--- src/usr.sbin/named.restart/named.restart.sh.orig    Mon Feb 12 17:59:01 2001
+++ src/usr.sbin/named.restart/named.restart.sh Mon Feb 12 18:00:33 2001
@@ -4,4 +4,12 @@
 # $FreeBSD: src/usr.sbin/named.restart/named.restart.sh,v 1.1.2.1 1999/08/29 15:44:26 peter Exp $
 #
 
-exec %DESTSBIN%/%INDOT%ndc restart
+# If there is a global system configuration file, suck it in.
+#
+if [ -f /etc/defaults/rc.conf ]; then
+       . /etc/defaults/rc.conf
+elif [ -f /etc/rc.conf ]; then
+       . /etc/rc.conf
+fi
+
+exec %DESTSBIN%/%INDOT%ndc restart ${named_flags}



>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: richard@gohome.net
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/25049: named.restart does not use named_flags from rc.conf
Date: Tue, 13 Feb 2001 09:11:42 +0200

 On Mon, Feb 12, 2001 at 06:02:42PM -0800, richard@gohome.net wrote:
 > 
 > >Number:         25049
 > >Category:       misc
 > >Synopsis:       named.restart does not use named_flags from rc.conf
 > >Originator:     Richard Roderick
 > >Release:        4.2
 > >Organization:
 > >Environment:
 > FreeBSD dns.pdx.uspops.com 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386
 > >Description:
 > named.restart does not maintain the named_flags, particularly when named is started via rc when rc.conf contains named_enable="YES"
 > >How-To-Repeat:
 > 
 > >Fix:
 > modify named.restart to include rc.conf and append ${named_flags} to the exec ndc restart line. Sample patch included.
 > 
 > --- src/usr.sbin/named.restart/named.restart.sh.orig    Mon Feb 12 17:59:01 2001
 > +++ src/usr.sbin/named.restart/named.restart.sh Mon Feb 12 18:00:33 2001
 > @@ -4,4 +4,12 @@
 >  # $FreeBSD: src/usr.sbin/named.restart/named.restart.sh,v 1.1.2.1 1999/08/29 15:44:26 peter Exp $
 >  #
 >  
 > -exec %DESTSBIN%/%INDOT%ndc restart
 > +# If there is a global system configuration file, suck it in.
 > +#
 > +if [ -f /etc/defaults/rc.conf ]; then
 > +       . /etc/defaults/rc.conf
 > +elif [ -f /etc/rc.conf ]; then
 > +       . /etc/rc.conf
 > +fi
 > +
 > +exec %DESTSBIN%/%INDOT%ndc restart ${named_flags}
 
 Shouldn't this be better done with the source_rc_confs mechanism introduced
 lately?  (it might be a good idea to have a -stable system handy before
 submitting bug reports, so you are sure you are not submitting something
 which has been fixed, or out of date :)
 
 G'luck,
 Peter
 
 -- 
 If I were you, who would be reading this sentence?
 

From: Richard Roderick <richard@gohome.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/25049: named.restart does not use named_flags from
  rc.conf
Date: Tue, 13 Feb 2001 02:09:24 -0800

 >Shouldn't this be better done with the source_rc_confs mechanism introduced
 >lately?  (it might be a good idea to have a -stable system handy before
 >submitting bug reports, so you are sure you are not submitting something
 >which has been fixed, or out of date :)
 
 (: ...This is my first attempt at helping... :)
 
 So, I went to my stable server and saw what you meant!  Of course this is a 
 small
 change isn't it? I'm not totally familiar with the addition of 
 source_rc_confs but I think
 I get it. So the patch I suggested would become the following, correct?
 
 diff -u named.restart.sh.orig named.restart.sh
 --- named.restart.sh.orig       Fri Aug 27 18:17:25 1999
 +++ named.restart.sh    Tue Feb 13 00:18:14 2001
 @@ -4,4 +4,13 @@
   # $FreeBSD: src/usr.sbin/named.restart/named.restart.sh,v 1.2 1999/08/28 
 01:17:25 peter Exp $
   #
 
 -exec %DESTSBIN%/%INDOT%ndc restart
 +# If there is a global system configuration file, suck it in.
 +#
 +if [ -r /etc/defaults/rc.conf ]; then
 +        . /etc/defaults/rc.conf
 +        source_rc_confs
 +elif [ -r /etc/rc.conf ]; then
 +        . /etc/rc.conf
 +fi
 +
 +exec %DESTSBIN%/%INDOT%ndc restart ${named_flags}
 
 
State-Changed-From-To: open->closed 
State-Changed-By: murray 
State-Changed-When: Tue Apr 10 19:13:03 PDT 2001 
State-Changed-Why:  
Fix committed to -current, thanks! 


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

From: Maxim Konovalov <maxim@macomnet.ru>
To: <freebsd-gnats-submit@FreeBSD.org>, <richard@gohome.net>
Cc:  
Subject: Re: misc/25049: named.restart does not use named flags from rc.conf
Date: Sun, 15 Apr 2001 20:41:46 +0400 (MSD)

 Hello,
 
 IMHO it is still a bit incorrect. How about this one:
 
 --- rc.conf.orig	Sun Apr 15 20:25:26 2001
 +++ rc.conf	Sun Apr 15 20:27:07 2001
 @@ -114,6 +114,7 @@
  named_program="named"		# path to named, if you want a different one.
  named_flags=""			# Flags for named
  #named_flags="-u bind -g bind"	# Flags for named
 +named_socket="/var/run/ndc"	# path to named control socket
 
  kerberos_server_enable="NO"	# Run a kerberos master server (or NO).
  kadmind_server_enable="NO"	# Run kadmind (or NO) -- do not run on
 
 --- named.reload.sh.orig	Sun Apr 15 20:30:55 2001
 +++ named.reload.sh	Sun Apr 15 20:34:16 2001
 @@ -4,4 +4,12 @@
  # $FreeBSD: src/usr.sbin/named.reload/named.reload.sh,v 1.2 1999/08/28 01:17:23 peter Exp $
  #
 
 -exec %DESTSBIN%/%INDOT%ndc reload
 +if [ -r /etc/defaults/rc.conf ]; then
 +	. /etc/defaults/rc.conf
 +	source_rc_confs
 +elif [ -r /etc/rc.conf ]; then
 +	. /etc/rc.conf
 +fi
 +
 +if [
 +exec %DESTSBIN%/%INDOT%ndc -c ${named_socket:-/var/run/ndc} reload
 
 --- named.restart.sh.orig	Sun Apr 15 20:28:15 2001
 +++ named.restart.sh	Sun Apr 15 20:35:52 2001
 @@ -10,4 +10,4 @@
  elif [ -r /etc/rc.conf ]; then
          . /etc/rc.conf
  fi
 -exec %DESTSBIN%/%INDOT%ndc restart ${named_flags}
 +exec %DESTSBIN%/%INDOT%ndc -c ${named_socket:-/var/run/ndc} -n {named_program} restart ${named_flags}
 
 - -maxim
 
 -- 
 Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
 phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru
 
>Unformatted:
