Date: Fri, 19 Nov 2010 13:55:42 +0300 From: Sergey Kandaurov <pluknet@gmail.com> To: Hiroki Sato <hrs@freebsd.org> Cc: dougb@freebsd.org, freebsd-rc@freebsd.org, freebsd-current@freebsd.org Subject: Re: [RFC] ifconfig description support in rc.d Message-ID: <AANLkTimOWhC1PHSu0SaUavTAPrhyNESdOWgAEEbxehBF@mail.gmail.com> In-Reply-To: <20101011.192914.82309657.hrs@allbsd.org> References: <AANLkTinfOSQGnk0%2BPK6iM0=v5CZn2vcmJZbA8TvgGbfr@mail.gmail.com> <4C76CA06.5010001@FreeBSD.org> <AANLkTintgji3vzrb8XuUQHWp%2B7YDvHtd7ynP0MmV0oZr@mail.gmail.com> <20101011.192914.82309657.hrs@allbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--0016363b8f2065c2b3049565bf68 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 11 October 2010 14:29, Hiroki Sato <hrs@freebsd.org> wrote: > Hi, > > pluknet <pluknet@gmail.com> wrote > =A0in <AANLkTintgji3vzrb8XuUQHWp+7YDvHtd7ynP0MmV0oZr@mail.gmail.com>: > > pl> On 27 August 2010 00:09, Doug Barton <dougb@freebsd.org> 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 patch = for > pl> > rc.conf.5 to describe this new functionality and I'll be happy to c= ommit 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 > > =A0I think using "ifconfig -l" here is not a good idea. =A0Setting a > =A0description for each interface in a function invoked by ifn_start() > =A0would be better. > > =A0This is beacuse the netif script can be run not only at boottime but > =A0also via devd or by hand for a specific interface. =A0So, if the > =A0ifnet_descr is there, "/etc/rc.d/netif start IF" does not make it > =A0run. =A0Since the description is a per-interface property, > =A0"/etc/rc.d/netif start IF" should set one, and "/etc/rc.d/netif stop > =A0IF" should clear one, IMHO. > > =A0Also, "ifconfig -l" is not compatible with $network_interfaces, so > =A0you need to use list_net_interface() for that purpose instead (if you > =A0move ifnet_descr() into ifn_start() it is useless, though). > Actually, both versions were developed at the same time. This one follows "netif" approach. Somehow it was rejected by me for some reasons which I don't remember for now. That's why I didn't include it to my original message. Please, see attached. --=20 wbr, pluknet P.S. Google marks patches as (application/octet-stream). Bad Google. --0016363b8f2065c2b3049565bf68 Content-Type: application/octet-stream; name="descr.rc.d.netif.patch" Content-Disposition: attachment; filename="descr.rc.d.netif.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ggoyd0vv1 SW5kZXg6IGV0Yy9uZXR3b3JrLnN1YnIKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gZXRjL25ldHdvcmsuc3Vicgko cmV2aXNpb24gMjE1NDIzKQorKysgZXRjL25ldHdvcmsuc3Vicgkod29ya2luZyBjb3B5KQpAQCAt NDcsNiArNDcsNyBAQAogCWlwdjRfdXAgJHtpZm59ICYmIGNmZz0wCiAJaXB2Nl91cCAke2lmbn0g JiYgY2ZnPTAKIAlpcHhfdXAgJHtpZm59ICYmIGNmZz0wCisJaWZkZXNjcl91cCAke2lmbn0gJiYg Y2ZnPTAKIAljaGlsZGlmX2NyZWF0ZSAke2lmbn0gJiYgY2ZnPTAKIAogCXJldHVybiAkY2ZnCkBA IC02OSw2ICs3MCw3IEBACiAJaXB2NF9kb3duICR7aWZufSAm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PT09PT09PT09PT09PT09PT09PT0KLS0tIGV0Yy9kZWZhdWx0cy9yYy5jb25mCShyZXZpc2lvbiAy MTU0MjMpCisrKyBldGMvZGVmYXVsdHMvcmMuY29uZgkod29ya2luZyBjb3B5KQpAQCAtMjE0LDYg KzIxNCw3IEBACiAjaWZjb25maWdfZWQwX2lwdjY9ImluZXQ2IDIwMDE6ZGI4OjE6OjEgcHJlZml4 bGVuIDY0IiAjIFNhbXBsZSBJUHY2IGFkZHIgZW50cnkKICNpZmNvbmZpZ19lZDBfYWxpYXMwPSJp bmV0NiAyMDAxOmRiODoyOjoxIHByZWZpeGxlbiA2NCIgIyBTYW1wbGUgSVB2NiBhbGlhcwogI2lm Y29uZmlnX2Z4cDBfbmFtZT0ibmV0MCIJIyBDaGFuZ2UgaW50ZXJmYWNlIG5hbWUgZnJvbSBmeHAw IHRvIG5ldDAuCisjaWZjb25maWdfZnhwMF9kZXNjcj0iVXBsaW5rIHRvIFN3aXRjaCAyIgkjIExh YmVsIGZ4cDAgaW50ZXJmYWNlCiAjdmxhbnNfZnhwMD0iMTAxIHZsYW4wIgkJIyB2bGFuKDQpIGlu dGVyZmFjZXMgZm9yIGZ4cDAgZGV2aWNlCiAjY3JlYXRlX2FyZ3NfdmxhbjA9InZsYW4gMTAyIgkj IHZsYW4gdGFnIGZvciB2bGFuMCBkZXZpY2UKICN3bGFuc19hdGgwPSJ3bGFuMCIJCSMgd2xhbig0 KSBpbnRlcmZhY2VzIGZvciBhdGgwIGRldmljZQo= --0016363b8f2065c2b3049565bf68--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimOWhC1PHSu0SaUavTAPrhyNESdOWgAEEbxehBF>