Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jun 1999 11:50:02 -0700 (PDT)
From:      Doug <Doug@gorean.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: conf/12432: empty amd_flags causes start failure in rc.network
Message-ID:  <199906281850.LAA37145@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/12432; it has been noted by GNATS.

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
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906281850.LAA37145>