From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Jul 5 15:30:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AAADAB71 for ; Fri, 5 Jul 2013 15:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 91FEA124E for ; Fri, 5 Jul 2013 15:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FU0iB097785 for ; Fri, 5 Jul 2013 15:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r65FU0SV097784; Fri, 5 Jul 2013 15:30:00 GMT (envelope-from gnats) Resent-Date: Fri, 5 Jul 2013 15:30:00 GMT Resent-Message-Id: <201307051530.r65FU0SV097784@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, Fabian Wenk Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24F8EA09 for ; Fri, 5 Jul 2013 15:26:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id F1EEC122B for ; Fri, 5 Jul 2013 15:25:59 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r65FPwEf070086 for ; Fri, 5 Jul 2013 15:25:58 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r65FPwYM070085; Fri, 5 Jul 2013 15:25:58 GMT (envelope-from nobody) Message-Id: <201307051525.r65FPwYM070085@oldred.freebsd.org> Date: Fri, 5 Jul 2013 15:25:58 GMT From: Fabian Wenk To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/180324: [PATCH] net-mgmt/ipv6mon modified rc.d script for multiple interfaces X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 15:30:00 -0000 >Number: 180324 >Category: ports >Synopsis: [PATCH] net-mgmt/ipv6mon modified rc.d script for multiple interfaces >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Jul 05 15:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Fabian Wenk >Release: 9.1-RELEASE-p4 >Organization: >Environment: FreeBSD superman.wenks.ch 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #3 r251905: Tue Jun 18 10:41:28 CEST 2013 root@superman.wenks.ch:/usr/obj/usr/src/sys/SUPERMAN amd64 >Description: I modified the rc.d/ipv6mon script to be able to start multiple instances of ipv6mon when multiple interfaces are present on the system. Explanation on how to use it is as comment in the script itself. Patch is attached. >How-To-Repeat: n/a >Fix: Apply the attached patch. Patch attached with submission follows: diff -ru ipv6mon.orig/files/ipv6mon.in ipv6mon/files/ipv6mon.in --- ipv6mon.orig/files/ipv6mon.in 2013-04-02 17:46:28.000000000 +0200 +++ ipv6mon/files/ipv6mon.in 2013-07-05 17:05:56.000000000 +0200 @@ -6,13 +6,51 @@ # BEFORE: LOGIN # KEYWORD: nojail shutdown +# To use ipv6mon with multiple interfaces, the following additional steps +# are needed (example with 2 interfaces, em0 and em1): +# +# Copy the %%PREFIX%%/etc/ipv6mon.conf to %%PREFIX%%/etc/ipv6mon-em0.conf and +# to %%PREFIX%%/etc/ipv6mon-em1.conf +# In both copied config files adjust 'NetworkInterface' accordingly with em0 +# and em1 and also adjust the 'LockFile' accordingly to +# /var/run/ipv6mon-em0.pid and /var/run/ipv6mon-em1.pid. +# Add in /etc/rc.conf the additional line: +# ipv6mon_interfaces="em0 em1" + + . /etc/rc.subr name="ipv6mon" rcvar="${name}_enable" command="%%PREFIX%%/sbin/${name}" -pidfile="/var/run/${name}.pid" required_files="%%PREFIX%%/etc/${name}.conf" load_rc_config $name -run_rc_command "$1" + +case ${ipv6mon_interfaces} in + '') + pidfile="/var/run/${name}.pid" + run_rc_command "$1" + ;; + + *) + case "$1" in + *start) + for interface in ${ipv6mon_interfaces}; do + eval options=\$ipv6mon_${interface}_options + command_args="${options} -c %%PREFIX%%/etc/${name}-${interface}.conf" + pidfile="/var/run/${name}-${interface}.pid" + run_rc_command "$1" + done + ;; + + *stop) + for interface in ${ipv6mon_interfaces}; do + eval options=\$ipv6mon_${interface}_options + pidfile="/var/run/${name}-${interface}.pid" + run_rc_command "$1" + done + ;; + esac + ;; +esac >Release-Note: >Audit-Trail: >Unformatted: