From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jul 17 04:30:22 2003 Return-Path: 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 7DB0F37B401 for ; Thu, 17 Jul 2003 04:30:22 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AD3943FAF for ; Thu, 17 Jul 2003 04:30:20 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6HBUKUp087414 for ; Thu, 17 Jul 2003 04:30:20 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6HBUKGT087413; Thu, 17 Jul 2003 04:30:20 -0700 (PDT) Resent-Date: Thu, 17 Jul 2003 04:30:20 -0700 (PDT) Resent-Message-Id: <200307171130.h6HBUKGT087413@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gleb Smirnoff Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C724037B401 for ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/54575: arpwatch.sh doesn't support multiple interfaces well X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 11:30:22 -0000 >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: