Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jul 2003 15:20:57 +0400 (MSD)
From:      Gleb Smirnoff <glebius@cell.sick.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/54575: arpwatch.sh doesn't support multiple interfaces well
Message-ID:  <200307171120.h6HBKvOk014343@cell.sick.ru>
Resent-Message-ID: <200307171130.h6HBUKGT087413@freefall.freebsd.org>

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

>Number:         54575
>Category:       ports
>Synopsis:       arpwatch.sh doesn't support multiple interfaces well
>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:   Thu Jul 17 04:30:19 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Gleb Smirnoff
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Bestcom ISP
>Environment:
System: FreeBSD gw-f.bestcom.ru 4.8-STABLE FreeBSD 4.8-STABLE #7: Wed Jul 2 16:22:29 GMT 2003 root@angst.bestcom.ru:/usr/obj/usr/src/sys/GW-F i386

>Description:
	  arpwatch.sh is not part of arpwatch 2.1.a11, but a part of its
	FreeBSD port. arpwatch.sh is installed into /usr/local/etc/rc.d
	and starts arpwatch at boot time.
	  It runs as many arpwatches as specified by variable
	${arpwatch_interfaces} in rc.conf. 
	  The problem is that all this arpwatch processes try to use 
	the same /usr/local/arpwatch/arp.dat. At shutdown time there 
	exists a race condition between them: each arpwatch process dumps
	his data into arp.dat, and there remains table of the last
	exited one.

>How-To-Repeat:
	Set ${arpwatch_interfaces} to a list of interfaces, more than 1.
	Run arpwatch, look at your mail, write down 'new stations'. 
	killall arpwatches, start arpwatch.sh again. Look at your mail.
	Some 'new stations' will appear again.

>Fix:
	Let each arpwatch use his own arp.${iface}.dat:

--- arpwatch.sh.orig	Thu Jul 17 12:31:20 2003
+++ arpwatch.sh	Thu Jul 17 12:30:18 2003
@@ -35,7 +35,8 @@
 		;;
 	*)
 		for interface in ${arpwatch_interfaces}; do
-			"$PREFIX"/sbin/arpwatch -i "${interface}" && echo -n " arpwatch(${interface})"
+			touch $PREFIX/arpwatch/arp.${interface}.dat 
+			"$PREFIX"/sbin/arpwatch -i "${interface}" -f arp.${interface}.dat && echo -n " arpwatch(${interface})"
 		done
 		;;
 	esac
>Release-Note:
>Audit-Trail:
>Unformatted:



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