ports/102600: [patch] ports/net-mgmt/arpwatch's rcNG script does not handle 'restart'

Eugene Grosbein eugen at grosbein.pp.ru
Mon Aug 28 17:30:42 UTC 2006


The following reply was made to PR ports/102600; it has been noted by GNATS.

From: Eugene Grosbein <eugen at grosbein.pp.ru>
To: bug-followup at freebsd.org
Cc: thomas at goodking.ca
Subject: Re: ports/102600: [patch] ports/net-mgmt/arpwatch's rcNG script does not handle 'restart'
Date: Tue, 29 Aug 2006 01:29:31 +0800

 Hi!
 
 There is another issue with this rcNG script.
 
 Using settings explained in the How-To-Repeat section,
 the script starts arpwatch without arguments while /etc/rc performes
 initial boot of the OS, that's bad. Being started manually when
 $1 is 'start', it starts arpwatch with needed arguments.
 But during initial boot $1 is 'faststart'.
 
 This is because 'arpwatch_interfaces=' at the beginning of the script
 that erases value set from /etc/rc.conf by rcorder before our script starts.
 /etc/rc.conf will not be sourced once more when out script runs
 during initial boot sequence so all /etc/rc.conf settings become lost.
 
 Corrected path follows. It does the following:
 
 - 'arpwatch_dir' now may be set in /etc/rc.conf and its value won't be
   redifined by force with %%PREFIX%%/arpwatch/. This makes sense
   for NanoBSD that generally keep /usr/local/arpwatch/ onto flash
   that is mounted read-only, so arpwatch_dir needs to be redifined
   to something like /var/arpwatch;
 - arpwatch_interfaces now is not ignored during faststart and restart.
 
 
 --- files/arpwatch.sh.in.orig	Mon Aug 28 17:38:19 2006
 +++ files/arpwatch.sh.in	Tue Aug 29 01:23:02 2006
 @@ -11,8 +11,7 @@
  #arpwatch_enable="YES"
  #
  arpwatch_enable=${arpwatch_enable:-"NO"}
 -arpwatch_dir="%%PREFIX%%/arpwatch/"
 -arpwatch_interfaces=
 +arpwatch_dir=${arpwatch_dir:-"%%PREFIX%%/arpwatch/"}
  
  . %%RC_SUBR%%
  
 @@ -63,15 +62,17 @@
      ;;
  
      *)
 -	 if [ "$1" = "start" ]; then
 +	 case "$1" in
 +         *start)
   	     for interface in ${arpwatch_interfaces}; do
  		 eval options=\$arpwatch_${interface}_options
  		 command_args="-i ${interface} ${options} -f arp.${interface}.dat"
 -		 pidfile="/var/run/arpwatch-${interface}.pid"
  		 run_rc_command "$1"
  	     done
 -	 else
 +	     ;;
 +         *)
               run_rc_command "$1"
 -	 fi
 +             ;;
 +	 esac
      ;;
  esac
 
 
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=102600



More information about the freebsd-ports-bugs mailing list