From doug@miva004.simplenet.net Mon Jun 28 09:50:46 1999
Return-Path: <doug@miva004.simplenet.net>
Received: from miva004.simplenet.net (unknown [209.132.1.204])
	by hub.freebsd.org (Postfix) with ESMTP id 6879914E12
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Jun 1999 09:50:39 -0700 (PDT)
	(envelope-from doug@miva004.simplenet.net)
Received: (from doug@localhost)
	by miva004.simplenet.net (8.9.3/8.9.3) id SAA00349;
	Tue, 15 Jun 1999 18:27:02 -0700 (PDT)
	(envelope-from doug)
Message-Id: <199906160127.SAA00349@miva004.simplenet.net>
Date: Tue, 15 Jun 1999 18:27:02 -0700 (PDT)
From: Studded@gorean.org
Sender: doug@miva004.simplenet.net
Reply-To: Studded@gorean.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: empty amd_flags causes start failure in rc.network
X-Send-Pr-Version: 3.2

>Number:         12432
>Category:       conf
>Synopsis:       empty amd_flags causes start failure in rc.network
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 28 10:00:00 PDT 1999
>Closed-Date:    Sun Apr 14 19:14:28 PDT 2002
>Last-Modified:  Sun Apr 14 19:14:28 PDT 2002
>Originator:     Doug
>Release:        FreeBSD 3.2-19990609-STABLE i386
>Organization:
AAAG
>Environment:

	3.2-Stable with amd enabled in /etc/rc.conf[.local]

>Description:

	With the following in /etc/rc.conf.local:

amd_enable="YES"
amd_flags=""
amd_map_program="NO"

	The daemon is not started by rc.network. When a trivial flag is added
(like "-F /etc/amd.conf") all works as advertised. 

>How-To-Repeat:

	See above. 100% repeatable.

>Fix:
	
	Looking at the shell script I'm not sure exactly why it's not working.
Everything seems above board, but the problem is verifiable. I can start it
from the command line with just 'amd' so the lack of flags is not a problem.

	Also, there are some style nits in rc.network. The biggest one is that
there are a number of tests like this:

if [ "X$conf_option" -eq X"YES" ]; ...

where the RHS should be "XYES" if you're going to use that style. On some
versions of sh "XYES" does not equal X"YES" but on ours it seems to work
anyway. Of course, all the rc scripts should be changed to use case anyway,
but that's another PR. :)

	Sorry I don't have a fix, but I felt this should be documented in
any case.

Doug


>Release-Note:
>Audit-Trail:

From: Doug <Doug@gorean.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: conf/12432: empty amd_flags causes start failure in rc.network
Date: Mon, 28 Jun 1999 11:48:33 -0700 (PDT)

 On Tue, 15 Jun 1999 Studded@gorean.org wrote:
 
 
 > 	With the following in /etc/rc.conf.local:
 > 
 > amd_enable="YES"
 > amd_flags=""
 > amd_map_program="NO"
 > 
 > 	The daemon is not started by rc.network. When a trivial flag is added
 > (like "-F /etc/amd.conf") all works as advertised. 
 
 > >Fix:
 > 	
 > 	Looking at the shell script I'm not sure exactly why it's not working.
 > Everything seems above board, but the problem is verifiable. I can start it
 > from the command line with just 'amd' so the lack of flags is not a problem.
 > 
 > 	Also, there are some style nits in rc.network. The biggest one is that
 > there are a number of tests like this:
 > 
 > if [ "X$conf_option" -eq X"YES" ]; ...
 > 
 > where the RHS should be "XYES" if you're going to use that style. On some
 > versions of sh "XYES" does not equal X"YES" but on ours it seems to work
 > anyway. Of course, all the rc scripts should be changed to use case anyway,
 > but that's another PR. :)
 
 	Heh... amazing what sendmail -q digs up. Turns out that this was
 actually fixed the same day I filed the PR, so I thought maybe I'd filed
 it confidential by accident. However the cvs notes for the fix indicate
 that the -p option can't be called without other flags, when the actual
 problem is that amd chokes on the null flag argument if no flags are
 specified. Here is a slightly cleaner fix.
 
 --- rc.network.Dist	Wed Jun 23 08:19:50 1999
 +++ rc.network	Mon Jun 28 11:41:38 1999
 @@ -310,16 +310,17 @@
  	    fi
      fi
  
 -    if [ "X${amd_enable}" = X"YES" ]; then
 +    if [ "X${amd_enable}" = "XYES" ]; then
  	    echo -n ' amd'
 -	    if [ "X${amd_map_program}" != X"NO" ]; then
 +	    if [ "X${amd_map_program}" != "XNO" ]; then
  		amd_flags="${amd_flags} `eval ${amd_map_program}`"
  	    fi
 +	    # amd does not like null flag arguments
  	    if [ -n "$amd_flags" ]
  	    then
 -	      amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
 +	      amd ${amd_flags} -p > /var/run/amd.pid 2> /dev/null
  	    else
 -	      amd 2> /dev/null
 +	      amd -p > /var/run/amd.pid 2> /dev/null
  	    fi
      fi
  
 
 Enjoy,
 
 Doug
 
 
Responsible-Changed-From-To: freebsd-bugs->doug 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Sun Sep 2 10:01:31 PDT 2001 
Responsible-Changed-Why:  
Doug originated the PR, and is now in the best position to fix it. :-) 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=12432 
Responsible-Changed-From-To: doug->dougb 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Sun Sep 2 14:28:47 PDT 2001 
Responsible-Changed-Why:  
Doug originated the PR, and is now in the best position to fix it. :-) 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=12432 
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Sat Mar 16 23:36:09 PST 2002 
State-Changed-Why:  

I just committed a fix for -current, I'll MFC soon. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=12432 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dougb 
State-Changed-When: Sun Apr 14 19:13:37 PDT 2002 
State-Changed-Why:  

Woo hoo.... actually managed to close this before it's 
3 year anniversary. 

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