From glebius@cell.sick.ru  Thu Jul 17 04:21:03 2003
Return-Path: <glebius@cell.sick.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C724037B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Jul 2003 04:21:03 -0700 (PDT)
Received: from cell.sick.ru (cell.sick.ru [195.91.162.238])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BA51D43F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Jul 2003 04:21:02 -0700 (PDT)
	(envelope-from glebius@cell.sick.ru)
Received: from cell.sick.ru (glebius@localhost [127.0.0.1])
	by cell.sick.ru (8.12.6/8.12.8) with ESMTP id h6HBKvNx014344
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 Jul 2003 15:20:58 +0400 (MSD)
	(envelope-from glebius@cell.sick.ru)
Received: (from glebius@localhost)
	by cell.sick.ru (8.12.6/8.12.6/Submit) id h6HBKvOk014343;
	Thu, 17 Jul 2003 15:20:57 +0400 (MSD)
Message-Id: <200307171120.h6HBKvOk014343@cell.sick.ru>
Date: Thu, 17 Jul 2003 15:20:57 +0400 (MSD)
From: Gleb Smirnoff <glebius@cell.sick.ru>
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: arpwatch.sh doesn't support multiple interfaces well
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54575
>Category:       ports
>Synopsis:       arpwatch.sh doesn't support multiple interfaces well
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    krion
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 17 04:30:19 PDT 2003
>Closed-Date:    Mon Nov 03 03:17:01 PST 2003
>Last-Modified:  Mon Nov 03 03:17:01 PST 2003
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->brian 
Responsible-Changed-By: arved 
Responsible-Changed-When: Fri Jul 18 05:28:48 PDT 2003 
Responsible-Changed-Why:  
over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54575 
Responsible-Changed-From-To: brian->freebsd-ports-bugs 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sun Nov 2 16:59:41 PST 2003 
Responsible-Changed-Why:  
Port maintainer was reset 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54575 
Responsible-Changed-From-To: freebsd-ports-bugs->krion 
Responsible-Changed-By: krion 
Responsible-Changed-When: Sun Nov 2 22:51:42 PST 2003 
Responsible-Changed-Why:  
I'll handle it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54575 
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Mon Nov 3 03:16:55 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54575 
>Unformatted:
