From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 03:32:54 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB091065674; Mon, 10 Aug 2009 03:32:54 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 96FC48FC1E; Mon, 10 Aug 2009 03:32:53 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 9E7435C06F; Mon, 10 Aug 2009 11:32:52 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 4200B55CDBED; Mon, 10 Aug 2009 11:32:52 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id kbXbJwxwhXTK; Mon, 10 Aug 2009 11:31:53 +0800 (CST) Received: from charlie.delphij.net (c-67-188-2-183.hsd1.ca.comcast.net [67.188.2.183]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 4952655CDBEE; Mon, 10 Aug 2009 11:31:40 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type; b=vWhK5eNNgQ2kt7Xx4igHeCMVqZiMGgZzOVvQo7rEF+S7WHbj74YwUdNekdZAZxDQo UOnQz0cx4Zh4BMWLSx1GA== Message-ID: <4A7F948A.2040602@delphij.net> Date: Sun, 09 Aug 2009 20:31:22 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Doug Barton References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> In-Reply-To: <4A7B487B.8060303@FreeBSD.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------010509080402050806060500" Cc: freebsd-rc@FreeBSD.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 03:32:54 -0000 This is a multi-part message in MIME format. --------------010509080402050806060500 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, Doug, Doug Barton wrote: > Xin LI wrote: >> Hi, >> >> Here is a new rc.d startup script, which helps to bind static ARP >> entries like this: >> >> static_arp_pairs="gw" >> arp_gw="172.16.1.254 00:1c:58:6a:7a:4c" >> >> At the beginning I was inclined to add an "options" part for this script >> which helps to set e.g. logging options for ARP but it looks that these >> would be redundant, i.e., can be done with easy /etc/sysctl.conf. >> >> Comments? > > This looks pretty good. My only suggestion would be to change the file > name, $name and PROVIDE to static_arp (and then in your example above > the second var would be static_arp_gw). I realize that currently we > have a non-trivial number of legacy variables that don't match their > related script names and/or $name, however going forward my preference > would be that we not add any more examples of this. I also think it's > a bit more descriptive of what you're doing in the script. Thanks for your comments, I have put together the revised patch, along with rc.conf.5 and defaults/rc.conf changes. Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! --------------010509080402050806060500 Content-Type: text/plain; name="staticarp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="staticarp.diff" Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 196086) +++ etc/defaults/rc.conf (working copy) @@ -357,6 +357,7 @@ ### Network routing options: ### defaultrouter="NO" # Set to default gateway (or NO). +static_arp_pairs="" # Set to static ARP list (or leave empty). static_routes="" # Set to static route list (or leave empty). natm_static_routes="" # Set to static route list for NATM (or leave empty). gateway_enable="NO" # Set to YES if this host will be a gateway. Index: etc/rc.d/Makefile =================================================================== --- etc/rc.d/Makefile (revision 196086) +++ etc/rc.d/Makefile (working copy) @@ -32,7 +32,7 @@ random rarpd resolv rfcomm_pppd_server root \ route6d routed routing rpcbind rtadvd rwho \ savecore sdpd securelevel sendmail \ - serial sppp statd swap1 \ + serial static_arp sppp statd swap1 \ syscons sysctl syslogd \ timed tmp \ ugidfw \ Index: etc/rc.d/static_arp =================================================================== --- etc/rc.d/static_arp (revision 0) +++ etc/rc.d/static_arp (revision 0) @@ -0,0 +1,70 @@ +#!/bin/sh +# +# Copyright (c) 2009 Xin LI +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Configure static ARP table +# +# $FreeBSD$ +# + +# PROVIDE: static_arp +# REQUIRE: netif +# KEYWORD: nojail + +. /etc/rc.subr + +name="static_arp" +start_cmd="static_arp_start" +stop_cmd="static_arp_stop" + +static_arp_start() +{ + if [ -n "${static_arp_pairs}" ]; then + echo -n 'Binding static ARP pair:' + for e in ${static_arp_pairs}; do + echo -n " ${e}" + eval arp_args=\$arp_${e} + arp -S ${arp_args} >/dev/null 2>&1 + done + echo '.' + fi +} + +static_arp_stop() +{ + if [ -n "${static_arp_pairs}" ]; then + echo -n 'Unbinding static ARP pair:' + for e in ${static_arp_pairs}; do + echo -n " ${e}" + eval arp_args=\$arp_${e} + arp_args=`echo ${arp_args} | sed -e s,..:..:..:..:..:..,,g` + arp -d ${arp_args} >/dev/null 2>&1 + done + echo '.' + fi +} + +load_rc_config $name +run_rc_command "$1" Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (revision 196086) +++ share/man/man5/rc.conf.5 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2009 +.Dd August 10, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -2227,6 +2227,23 @@ .Pq Vt str The IPv6 equivalent of .Va defaultrouter . +.It Va static_arp_pairs +.Pq Vt str +Set to the list of static ARP paris that are to be added at system +boot time. +For each whitespace separated +.Ar element +in the value, a +.Va +arp_ Ns Aq Ar element +variable is assumed to exist whose contents will later be passed to a +.Dq Nm arp Cm -S +operation. +For example +.Bd -literal +static_arp_pairs="gw" +arp_gw="192.168.1.1 00:01:02:03:04:05" +.Ed .It Va static_routes .Pq Vt str Set to the list of static routes that are to be added at system --------------010509080402050806060500-- From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 04:15:13 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D331C106564A for ; Mon, 10 Aug 2009 04:15:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 659AE8FC1E for ; Mon, 10 Aug 2009 04:15:13 +0000 (UTC) Received: (qmail 6378 invoked by uid 399); 10 Aug 2009 04:15:08 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 10 Aug 2009 04:15:08 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A7F9EC6.9090605@FreeBSD.org> Date: Sun, 09 Aug 2009 21:15:02 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.22 (X11/20090729) MIME-Version: 1.0 To: d@delphij.net References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> In-Reply-To: <4A7F948A.2040602@delphij.net> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 04:15:14 -0000 Xin LI wrote: > Thanks for your comments, I have put together the revised patch, along > with rc.conf.5 and defaults/rc.conf changes. Glad to help. This looks fine except that you need an entry for static_arp_enable in defaults rc.conf and rc.conf.5. Once you get that into the patch I would send it to -net for a final review, then ask re@ to commit it. Since this is off by default and affects only a small group of users I don't see any reason we can't add it, even at this late date. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 05:05:21 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1F821065670; Mon, 10 Aug 2009 05:05:21 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 818328FC2B; Mon, 10 Aug 2009 05:05:21 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 680A25C06F; Mon, 10 Aug 2009 13:05:20 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id F2AB655CDBF0; Mon, 10 Aug 2009 13:05:19 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id L4G2XWTUaGmP; Mon, 10 Aug 2009 13:04:26 +0800 (CST) Received: from charlie.delphij.net (c-67-188-2-183.hsd1.ca.comcast.net [67.188.2.183]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 539B655CDBF4; Mon, 10 Aug 2009 13:04:20 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=VhVtDyZG4Ub3GSWhq822jztVC1LDZ93THNr1krj2BmIMCvnNvv8+XKsxo9cz1Uloc 7Lzym/ed1NmB5i2vENkug== Message-ID: <4A7FAA42.4030607@delphij.net> Date: Sun, 09 Aug 2009 22:04:02 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Doug Barton References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> In-Reply-To: <4A7F9EC6.9090605@FreeBSD.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 05:05:22 -0000 Hi, Doug, Doug Barton wrote: > Xin LI wrote: > >> Thanks for your comments, I have put together the revised patch, along >> with rc.conf.5 and defaults/rc.conf changes. > > Glad to help. This looks fine except that you need an entry for > static_arp_enable in defaults rc.conf and rc.conf.5. This script does not require the enable knob. If the static_arp_pairs is not empty then the script would add the entries, otherwise it will not do that. Do you think we need an "enable" knob for it? I can add it but I don't feel strongly for the idea, since it would make a redundant entry to represent the same semantic. Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 05:35:34 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30573106564A for ; Mon, 10 Aug 2009 05:35:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id BE3AD8FC20 for ; Mon, 10 Aug 2009 05:35:33 +0000 (UTC) Received: (qmail 15354 invoked by uid 399); 10 Aug 2009 05:35:29 -0000 Received: from localhost (HELO ?192.168.0.100?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 10 Aug 2009 05:35:29 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Date: Sun, 9 Aug 2009 22:34:55 -0700 (PDT) From: Doug Barton To: d@delphij.net In-Reply-To: <4A7FAA42.4030607@delphij.net> Message-ID: References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.FreeBSD.org/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-rc@FreeBSD.org Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 05:35:34 -0000 On Sun, 9 Aug 2009, Xin LI wrote: > Hi, Doug, > > Doug Barton wrote: >> Xin LI wrote: >> >>> Thanks for your comments, I have put together the revised patch, along >>> with rc.conf.5 and defaults/rc.conf changes. >> >> Glad to help. This looks fine except that you need an entry for >> static_arp_enable in defaults rc.conf and rc.conf.5. > > This script does not require the enable knob. If the static_arp_pairs > is not empty then the script would add the entries, otherwise it will > not do that. Do you think we need an "enable" knob for it? I can add > it but I don't feel strongly for the idea, since it would make a > redundant entry to represent the same semantic. I missed the fact that you're not using rcvar. I'm sort of ambivalent about that, as I prefer things to be consistent, but I'm not actively opposed to it. If no one else has an objection go ahead and send it to -net. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 11:07:04 2009 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09AD21065672 for ; Mon, 10 Aug 2009 11:07:04 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EB96E8FC34 for ; Mon, 10 Aug 2009 11:07:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7AB736G025288 for ; Mon, 10 Aug 2009 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7AB7340025284 for freebsd-rc@FreeBSD.org; Mon, 10 Aug 2009 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 10 Aug 2009 11:07:03 GMT Message-Id: <200908101107.n7AB7340025284@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 11:07:04 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/134918 rc rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132766 rc wait_for_pids() in /etc/rc.subr is dull. o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/130414 rc [patch] rc services started with onestart are not stop o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/127917 rc [patch] dumpon rejects on start with physmem>swap even o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped o bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/120228 rc [zfs] [patch] Split ZFS volume startup / ease ZFS swap o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 59 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 15:45:21 2009 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED17106564A; Mon, 10 Aug 2009 15:45:21 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C57D28FC36; Mon, 10 Aug 2009 15:45:21 +0000 (UTC) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7AFjLWD052968; Mon, 10 Aug 2009 15:45:21 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7AFjL6a052964; Mon, 10 Aug 2009 15:45:21 GMT (envelope-from linimon) Date: Mon, 10 Aug 2009 15:45:21 GMT Message-Id: <200908101545.n7AFjL6a052964@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/137629: [rc] background_dhclient rc.conf option causing double nfs mounts X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 15:45:22 -0000 Old Synopsis: background_dhclient rc.conf option causing double nfs mounts New Synopsis: [rc] background_dhclient rc.conf option causing double nfs mounts Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Mon Aug 10 15:44:37 UTC 2009 Responsible-Changed-Why: I'm not sure if this is a problem in the rc scripts or not. Comments? http://www.freebsd.org/cgi/query-pr.cgi?pr=137629 From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 18:44:30 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA06F106566C; Mon, 10 Aug 2009 18:44:30 +0000 (UTC) (envelope-from ady@ady.ro) Received: from mail-ew0-f206.google.com (mail-ew0-f206.google.com [209.85.219.206]) by mx1.freebsd.org (Postfix) with ESMTP id F3AEB8FC1E; Mon, 10 Aug 2009 18:44:29 +0000 (UTC) Received: by ewy2 with SMTP id 2so3203610ewy.43 for ; Mon, 10 Aug 2009 11:44:28 -0700 (PDT) MIME-Version: 1.0 Sender: ady@ady.ro Received: by 10.210.10.8 with SMTP id 8mr5250984ebj.82.1249928014495; Mon, 10 Aug 2009 11:13:34 -0700 (PDT) In-Reply-To: References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> Date: Mon, 10 Aug 2009 20:13:34 +0200 X-Google-Sender-Auth: 638977484a586987 Message-ID: <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> From: Adrian Penisoara To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-rc@freebsd.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 18:44:31 -0000 Hi, On Mon, Aug 10, 2009 at 7:34 AM, Doug Barton wrote: > On Sun, 9 Aug 2009, Xin LI wrote: > > Hi, Doug, >> >> Doug Barton wrote: >> >>> Xin LI wrote: >>> >>> Thanks for your comments, I have put together the revised patch, along >>>> with rc.conf.5 and defaults/rc.conf changes. >>>> >>> >>> Glad to help. This looks fine except that you need an entry for >>> static_arp_enable in defaults rc.conf and rc.conf.5. >>> >> >> This script does not require the enable knob. If the static_arp_pairs >> is not empty then the script would add the entries, otherwise it will >> not do that. Do you think we need an "enable" knob for it? I can add >> it but I don't feel strongly for the idea, since it would make a >> redundant entry to represent the same semantic. >> > > I missed the fact that you're not using rcvar. I'm sort of ambivalent about > that, as I prefer things to be I guess you could compare this to the cloned_interfaces rcvar... > consistent, but I'm not actively opposed to it. If no one else has an > objection go ahead and send it to -net. > Just a bit of QC/improvement: Index: etc/rc.d/static_arp =================================================================== - echo -n 'Binding static ARP pair:' + echo -n 'Binding static ARP pair(s):' - arp_args=`echo ${arp_args} | sed -e s,..:..:..:..:..:..,,g` + arp_args=`echo ${arp_args} | awk '{ print $1 }'` Index: share/man/man5/rc.conf.5 =================================================================== -Set to the list of static ARP paris that are to be added at system +Set to the list of static ARP pairs that are to be added at system Regards, Adrian Penisoara EnterpriseBSD From owner-freebsd-rc@FreeBSD.ORG Mon Aug 10 18:56:40 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC284106566C; Mon, 10 Aug 2009 18:56:40 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 04C8A8FC16; Mon, 10 Aug 2009 18:56:40 +0000 (UTC) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 2CA4C5C025; Tue, 11 Aug 2009 02:56:39 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id BDD6F55CDC0A; Tue, 11 Aug 2009 02:56:38 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id LTNMJ4kQJQZI; Tue, 11 Aug 2009 02:55:44 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 5375155CDBF2; Tue, 11 Aug 2009 02:55:37 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type; b=enUsXLD3JMGOB7rUE96NwK5VQTkEBrMIampuNu42XVrpSGo27SBwsv6RSLp3Lbi5I F5oXKKdckVEG2kRGgbglQ== Message-ID: <4A806D17.9020404@delphij.net> Date: Mon, 10 Aug 2009 11:55:19 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090803) MIME-Version: 1.0 To: Adrian Penisoara References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> In-Reply-To: <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------010607040803050109010607" Cc: freebsd-rc@freebsd.org, Doug Barton , d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 18:56:41 -0000 This is a multi-part message in MIME format. --------------010607040803050109010607 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Adrian, Adrian Penisoara wrote: [...] > Just a bit of QC/improvement: > > Index: etc/rc.d/static_arp > =================================================================== > - echo -n 'Binding static ARP pair:' > + echo -n 'Binding static ARP pair(s):' Thanks, I have changed both. > - arp_args=`echo ${arp_args} | sed -e > s,..:..:..:..:..:..,,g` > + arp_args=`echo ${arp_args} | awk '{ print $1 }'` After carefully reading the sh(1) manual, I find another way which does not need to use any sed/awk at all: arp -d ${arp_args%%[ ]*} > /dev/null 2>&1 > Index: share/man/man5/rc.conf.5 > =================================================================== > -Set to the list of static ARP paris that are to be added at system > +Set to the list of static ARP pairs that are to be added at system Thanks, changed in the patch. Here is the revised patch based on your comments. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqAbRYACgkQi+vbBBjt66ADfwCgp79vVw0kMv1qYYc7Lmjkwn6s FEAAnjjOxHVBifAKpbnnU01XOZynij6W =P5jW -----END PGP SIGNATURE----- --------------010607040803050109010607 Content-Type: text/plain; name="staticarp-20090810.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="staticarp-20090810.diff" Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 196086) +++ etc/defaults/rc.conf (working copy) @@ -357,6 +357,7 @@ ### Network routing options: ### defaultrouter="NO" # Set to default gateway (or NO). +static_arp_pairs="" # Set to static ARP list (or leave empty). static_routes="" # Set to static route list (or leave empty). natm_static_routes="" # Set to static route list for NATM (or leave empty). gateway_enable="NO" # Set to YES if this host will be a gateway. Index: etc/rc.d/Makefile =================================================================== --- etc/rc.d/Makefile (revision 196086) +++ etc/rc.d/Makefile (working copy) @@ -32,7 +32,7 @@ random rarpd resolv rfcomm_pppd_server root \ route6d routed routing rpcbind rtadvd rwho \ savecore sdpd securelevel sendmail \ - serial sppp statd swap1 \ + serial static_arp sppp statd swap1 \ syscons sysctl syslogd \ timed tmp \ ugidfw \ Index: etc/rc.d/static_arp =================================================================== --- etc/rc.d/static_arp (revision 0) +++ etc/rc.d/static_arp (revision 0) @@ -0,0 +1,69 @@ +#!/bin/sh +# +# Copyright (c) 2009 Xin LI +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Configure static ARP table +# +# $FreeBSD$ +# + +# PROVIDE: static_arp +# REQUIRE: netif +# KEYWORD: nojail + +. /etc/rc.subr + +name="static_arp" +start_cmd="static_arp_start" +stop_cmd="static_arp_stop" + +static_arp_start() +{ + if [ -n "${static_arp_pairs}" ]; then + echo -n 'Binding static ARP pair(s):' + for e in ${static_arp_pairs}; do + echo -n " ${e}" + eval arp_args=\$arp_${e} + arp -S ${arp_args} >/dev/null 2>&1 + done + echo '.' + fi +} + +static_arp_stop() +{ + if [ -n "${static_arp_pairs}" ]; then + echo -n 'Unbinding static ARP pair(s):' + for e in ${static_arp_pairs}; do + echo -n " ${e}" + eval arp_args=\$arp_${e} + arp -d ${arp_args%%[ ]*} > /dev/null 2>&1 + done + echo '.' + fi +} + +load_rc_config $name +run_rc_command "$1" Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (revision 196086) +++ share/man/man5/rc.conf.5 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2009 +.Dd August 10, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -2227,6 +2227,23 @@ .Pq Vt str The IPv6 equivalent of .Va defaultrouter . +.It Va static_arp_pairs +.Pq Vt str +Set to the list of static ARP pairs that are to be added at system +boot time. +For each whitespace separated +.Ar element +in the value, a +.Va +arp_ Ns Aq Ar element +variable is assumed to exist whose contents will later be passed to a +.Dq Nm arp Cm -S +operation. +For example +.Bd -literal +static_arp_pairs="gw" +arp_gw="192.168.1.1 00:01:02:03:04:05" +.Ed .It Va static_routes .Pq Vt str Set to the list of static routes that are to be added at system --------------010607040803050109010607-- From owner-freebsd-rc@FreeBSD.ORG Tue Aug 11 00:01:36 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E74A91065675; Tue, 11 Aug 2009 00:01:36 +0000 (UTC) (envelope-from ady@ady.ro) Received: from mail-ew0-f206.google.com (mail-ew0-f206.google.com [209.85.219.206]) by mx1.freebsd.org (Postfix) with ESMTP id 2E0CA8FC25; Tue, 11 Aug 2009 00:01:35 +0000 (UTC) Received: by ewy2 with SMTP id 2so3375555ewy.43 for ; Mon, 10 Aug 2009 17:01:35 -0700 (PDT) MIME-Version: 1.0 Sender: ady@ady.ro Received: by 10.211.199.11 with SMTP id b11mr5634837ebq.68.1249948894969; Mon, 10 Aug 2009 17:01:34 -0700 (PDT) In-Reply-To: <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> References: <4A7B2792.4090803@delphij.net> <4A7B487B.8060303@FreeBSD.org> <4A7F948A.2040602@delphij.net> <4A7F9EC6.9090605@FreeBSD.org> <4A7FAA42.4030607@delphij.net> <78cb3d3f0908101113s412021adk8956dd083a8fed72@mail.gmail.com> Date: Tue, 11 Aug 2009 02:01:34 +0200 X-Google-Sender-Auth: 916db593d9e98142 Message-ID: <78cb3d3f0908101701o6ea649cfk6a7d5e721d079866@mail.gmail.com> From: Adrian Penisoara To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-rc@freebsd.org, d@delphij.net Subject: Re: [RFC] script for binding ARP <-> IP pairs X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 00:01:37 -0000 Hi, On Mon, Aug 10, 2009 at 8:13 PM, Adrian Penisoara wrote: > Hi, > > On Mon, Aug 10, 2009 at 7:34 AM, Doug Barton wrote: > >> On Sun, 9 Aug 2009, Xin LI wrote: >> >> Hi, Doug, >>> >>> Doug Barton wrote: >>> >>>> Xin LI wrote: >>>> >>>> Thanks for your comments, I have put together the revised patch, along >>>>> with rc.conf.5 and defaults/rc.conf changes. >>>>> >>>> >>>> Glad to help. This looks fine except that you need an entry for >>>> static_arp_enable in defaults rc.conf and rc.conf.5. >>>> >>> >>> This script does not require the enable knob. If the static_arp_pairs >>> is not empty then the script would add the entries, otherwise it will >>> not do that. Do you think we need an "enable" knob for it? I can add >>> it but I don't feel strongly for the idea, since it would make a >>> redundant entry to represent the same semantic. >>> >> >> I missed the fact that you're not using rcvar. I'm sort of ambivalent >> about that, as I prefer things to be > > > I guess you could compare this to the cloned_interfaces rcvar... > > I stand corrected: it's rather more similar to the "static_routes / route_xxx" concept. I guess we have an entire class of such rc subroutines which are not $name_enable'd. Regards, Adrian.