Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Aug 2006 13:07:19 GMT
From:      Jordan Gordeev <jgordeev@dir.bg>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/101462: [patch] bug in rc script of net-mgmt/arpwatch when multiple interfaces should be monitored
Message-ID:  <200608061307.k76D7Jur028790@www.freebsd.org>
Resent-Message-ID: <200608061310.k76DAE1n077688@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         101462
>Category:       ports
>Synopsis:       [patch] bug in rc script of net-mgmt/arpwatch when multiple interfaces should be monitored
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 06 13:10:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jordan Gordeev
>Release:        6.1-RELEASE
>Organization:
>Environment:
>Description:
When the variable "arpwatch_interfaces" is set to a list of interfaces in /etc/rc.conf and "arpwatch_enable" is set to "YES" the rc script of arpwatch should start multiple copies of arpwatch, one for each interface. But upon reboot the rc script is normally called with "faststart" (not "start") as the sole argument, which the script does not handle correctly. As a result only one copy of arpwatch is started, with no arguments.
>How-To-Repeat:
Set the following in /etc/rc.conf:
arpwatch_enable="YES"
arpwatch_interfaces="fxp0 rl0" #a list of two or more interfaces

Then reboot the machine. Alternatively try starting arpwatch with "/usr/local/etc/rc.d/arpwatch faststart"
After the reboot verify that only one copy of arpwatch is running.
>Fix:
The simplest fix is to make the rc script handle "faststart" the same as "start".
A patch follows.
--- arpwatch.old        Sun Aug  6 15:02:21 2006
+++ arpwatch    Sun Aug  6 15:10:59 2006
@@ -63,7 +63,7 @@
     ;;

     *)
-        if [ "$1" = "start" ]; then
+        if [ "$1" = "start" -o "$1" = "faststart" ]; then
             for interface in ${arpwatch_interfaces}; do
                 eval options=\$arpwatch_${interface}_options
                 command_args="-i ${interface} ${options} -f arp.${interface}.dat"


Another fix is to rewrite the rc script or rewrite arpwatch so that single process monitors multiple interfaces.
>Release-Note:
>Audit-Trail:
>Unformatted:



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