From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Aug 28 17:30:42 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0290716A4DD for ; Mon, 28 Aug 2006 17:30:42 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C7CB43D5F for ; Mon, 28 Aug 2006 17:30:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7SHUUeT036428 for ; Mon, 28 Aug 2006 17:30:30 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7SHUUNr036427; Mon, 28 Aug 2006 17:30:30 GMT (envelope-from gnats) Date: Mon, 28 Aug 2006 17:30:30 GMT Message-Id: <200608281730.k7SHUUNr036427@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: ports/102600: [patch] ports/net-mgmt/arpwatch's rcNG script does not handle 'restart' X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 17:30:42 -0000 The following reply was made to PR ports/102600; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: thomas@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