From owner-freebsd-rc@FreeBSD.ORG Sun Oct 10 17:45:03 2010 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 BCE12106566B for ; Sun, 10 Oct 2010 17:45:03 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4E28FC08 for ; Sun, 10 Oct 2010 17:45:03 +0000 (UTC) Received: by iwn8 with SMTP id 8so3574154iwn.13 for ; Sun, 10 Oct 2010 10:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=d7g4DoVKRWMbEIFdnmlUlgbeCBw1Co15pK/o6HMWNnM=; b=sygAbuTnT5MXLfF0rP7FuyPdQ+612wmr+aTjQ5au3CI6TgK+LN2GFZxyB0ZcBmFxTh P7YdN/xjSYomYZoohQAuonSGZCdqFE0lbsvaOtUtcMI+q5Q5KQmQsQCauBNo8GoKuB2c PwmlSxLcmEZlVHTHItJ/rZCunCkqXghAAV/DI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=l0Yc5ZVsI2jIidmBpMlxp+6twome9JutXKeh8ENm4aqGAcdYSClLrIihFhgKgbb69D Jgq6D1Fntl2w4tCA1kUqMGpa/uUOQCQ6OfTMHAH/F2D5KHyCUFFe6lvGiK4rMqUpnft9 oEApApUbAxRXerGIo1qkHKlZShjm0ByxA2RU4= MIME-Version: 1.0 Received: by 10.231.12.11 with SMTP id v11mr2224140ibv.13.1286731385016; Sun, 10 Oct 2010 10:23:05 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.231.184.3 with HTTP; Sun, 10 Oct 2010 10:23:04 -0700 (PDT) In-Reply-To: References: <4C76CA06.5010001@FreeBSD.org> <4CB135F5.20804@DataIX.net> Date: Sun, 10 Oct 2010 10:23:04 -0700 X-Google-Sender-Auth: MLEfSXI5xQ9R6uf-VpTNILAmtPM Message-ID: From: Garrett Cooper To: Sergey Kandaurov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: jhell , Doug Barton , freebsd-rc@freebsd.org, FreeBSD Current Subject: Re: [RFC] ifconfig description support in rc.d 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: Sun, 10 Oct 2010 17:45:03 -0000 On Sat, Oct 9, 2010 at 11:29 PM, Sergey Kandaurov wrote= : > On 10 October 2010 07:41, jhell wrote: >> On 08/27/2010 05:17, pluknet wrote: >>> On 27 August 2010 00:09, Doug Barton wrote: >>>> On 08/26/2010 12:53 PM, pluknet wrote: >>>>> >>>>> [cc'ing current@ as rc@ looks too quite] >>>>> >>>>> Hi. >>>>> >>>>> Since ifconfig has grown to label interfaces with >>>>> ifconfig $ifname description "foobar", what about >>>>> to give it more life and store i/face descriptions >>>>> semi-permanently, so they will survive between reboots? >>>>> >>>>> This patch adds a functionality to rc.d to label >>>>> interfaces at boot time. >>>>> >>>>> Comments are welcome. >>>> >>>> This seems like a good addition, thanks. Please also write a patch for >>>> rc.conf.5 to describe this new functionality and I'll be happy to comm= it it. >>> >>> Xin Li helped me with updating rc.conf.5 (thanks!). >>> It's included in attached patch. >>> >>>> =A0One note below. >>>> >>>> >>>>> --- etc/network.subr =A0 =A0(revision 211280) >>>>> +++ etc/network.subr =A0 =A0(working copy) >>>>> @@ -1187,6 +1187,24 @@ >>>>> =A0 =A0 =A0 =A0 return 0 >>>>> =A0} >>>>> >>>>> +# ifnet_descr >>>>> +# =A0 =A0 =A0Add description to all requested interfaces. >>>>> +# >>>>> +ifnet_descr() >>>>> +{ >>>>> + =A0 =A0 =A0 local _if _ifdescr >>>>> + >>>>> + =A0 =A0 =A0 # ifconfig_IF_descr >>>>> + =A0 =A0 =A0 for _if in `ifconfig -l`; do >>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 _ifdescr=3D"`get_if_var $_if ifconfig_I= F_descr`" >>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if [ ! -z "$_ifdescr" ]; then >>>> >>>> This is probably better as [ -n "$_ifdescr" ] >>>> >>> >>> This was blindly copy&pasted after ifnet_rename(). >>> So, it makes sense probably to change test expression there as well. >>> [see ifnet_rename() proposed change below inline] >>> This change to ifnet_rename() is not included in attached patch >>> to not complicate things unnecessarily for now. >>> >>> Index: etc/network.subr >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- etc/network.subr =A0 =A0(revision 211280) >>> +++ etc/network.subr =A0 =A0(working copy) >>> @@ -1179,7 +1179,7 @@ >>> =A0 =A0 =A0 =A0 # ifconfig_IF_name >>> =A0 =A0 =A0 =A0 for _if in `ifconfig -l`; do >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 _ifname=3D`get_if_var $_if ifconfig_IF_= name` >>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if [ ! -z "$_ifname" ]; then >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if [ -n "$_ifname" ]; then >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifconfig $_if name $_if= name >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fi >>> =A0 =A0 =A0 =A0 done >> >> Was this ever committed ? If so does anyone have any referring svn >> revisions ? >> >> Also if this is committed or planned to be committed is there a chance >> it could be MFC'd ? >> >> Would be awesome if this was available on a production release without >> patching ;) >> > > Hi. > > I'm going to commit this after a proper review. I'm not sure it would get resolved after this commit, but one minor annoyance is that restarting the netif rc.d script purges all gateways set, so I have to do and restart the routing rc.d script (if my connectivity doesn't get whacked). I think there was something else with natd and ipfw that I've run into in the past where I've restarted those scripts and things weren't all puppydogs and rainbows on my CURRENT systems. Thanks, -Garrett