From owner-freebsd-current@FreeBSD.ORG Mon Oct 11 10:29:44 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92C3D106564A; Mon, 11 Oct 2010 10:29:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4FD2F8FC14; Mon, 11 Oct 2010 10:29:43 +0000 (UTC) Received: from alph.d.allbsd.org (p3165-ipbf2308funabasi.chiba.ocn.ne.jp [114.148.246.165]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.3) with ESMTP id o9BATO0F004040; Mon, 11 Oct 2010 19:29:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.4/8.14.4) with ESMTP id o9BATMUK051667; Mon, 11 Oct 2010 19:29:24 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 11 Oct 2010 19:29:14 +0900 (JST) Message-Id: <20101011.192914.82309657.hrs@allbsd.org> To: pluknet@gmail.com From: Hiroki Sato In-Reply-To: References: <4C76CA06.5010001@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Oct_11_19_29_14_2010_564)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Mon, 11 Oct 2010 19:29:38 +0900 (JST) X-Spam-Status: No, score=-96.6 required=13.0 tests=CONTENT_TYPE_PRESENT, FAKEDWORD_BACKQUOTE,FORGED_RCVD_IP,MIMEQENC,QENCPTR2,RCVD_IN_CHINA, RCVD_IN_CHINA_KR, RCVD_IN_PBL, RCVD_IN_TAIWAN, SPF_SOFTFAIL, USER_IN_WHITELIST, X_MAILER_PRESENT autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gatekeeper.allbsd.org Cc: freebsd-current@FreeBSD.org, dougb@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: [RFC] ifconfig description support in rc.d X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 10:29:44 -0000 ----Security_Multipart(Mon_Oct_11_19_29_14_2010_564)-- Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, pluknet wrote in : pl> On 27 August 2010 00:09, Doug Barton wrote: pl> > On 08/26/2010 12:53 PM, pluknet wrote: pl> >> pl> >> [cc'ing current@ as rc@ looks too quite] pl> >> pl> >> Hi. pl> >> pl> >> Since ifconfig has grown to label interfaces with pl> >> ifconfig $ifname description "foobar", what about pl> >> to give it more life and store i/face descriptions pl> >> semi-permanently, so they will survive between reboots? pl> >> pl> >> This patch adds a functionality to rc.d to label pl> >> interfaces at boot time. pl> >> pl> >> Comments are welcome. pl> > pl> > This seems like a good addition, thanks. Please also write a patc= h for pl> > rc.conf.5 to describe this new functionality and I'll be happy to= commit it. pl> = pl> Xin Li helped me with updating rc.conf.5 (thanks!). pl> It's included in attached patch. (snip) pl> >> + =A0 =A0 =A0 # ifconfig_IF_descr pl> >> + =A0 =A0 =A0 for _if in `ifconfig -l`; do I think using "ifconfig -l" here is not a good idea. Setting a description for each interface in a function invoked by ifn_start() would be better. This is beacuse the netif script can be run not only at boottime but also via devd or by hand for a specific interface. So, if the ifnet_descr is there, "/etc/rc.d/netif start IF" does not make it run. Since the description is a per-interface property, "/etc/rc.d/netif start IF" should set one, and "/etc/rc.d/netif stop IF" should clear one, IMHO. Also, "ifconfig -l" is not compatible with $network_interfaces, so you need to use list_net_interface() for that purpose instead (if you move ifnet_descr() into ifn_start() it is useless, though). -- Hiroki ----Security_Multipart(Mon_Oct_11_19_29_14_2010_564)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkyy5voACgkQTyzT2CeTzy3yDgCgwGGsv/3cH6Ayycz4Yi4hsaYw rmMAnjEngZlkiYgjmOr/t4m48P91GtYv =ilJ8 -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Oct_11_19_29_14_2010_564)----