Bug 101462 - [patch] bug in rc script of net-mgmt/arpwatch when multiple interfaces should be monitored
Summary: [patch] bug in rc script of net-mgmt/arpwatch when multiple interfaces should...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Rong-En Fan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-06 14:10 UTC by Jordan Gordeev
Modified: 2006-08-20 11:54 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jordan Gordeev 2006-08-06 14:10:14 UTC
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.

Fix: The simplest fix is to make the rc script handle "faststart" the same as "start".
A patch follows.


*)
-        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.--1jM9vDt4oIuLW87HN9oFC3ets5cKuUO4hC8jca2Fo0o1SsTX
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- arpwatch.old        Sun Aug  6 15:02:21 2006
+++ arpwatch    Sun Aug  6 15:10:59 2006
@@ -63,7 +63,7 @@
     ;;
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.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-08-06 14:10:20 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Thomas Abthorpe 2006-08-08 21:11:31 UTC
I concur with the patch, please commit.


Thomas
Comment 3 Rong-En Fan freebsd_committer freebsd_triage 2006-08-19 06:10:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rafan

Eat.
Comment 4 Rong-En Fan freebsd_committer freebsd_triage 2006-08-20 11:54:10 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!