[RFC] ifconfig description support in rc.d
Sergey Kandaurov
pluknet at gmail.com
Fri Nov 19 11:22:58 UTC 2010
On 11 October 2010 14:29, Hiroki Sato <hrs at freebsd.org> wrote:
> Hi,
>
> pluknet <pluknet at gmail.com> wrote
> in <AANLkTintgji3vzrb8XuUQHWp+7YDvHtd7ynP0MmV0oZr at mail.gmail.com>:
>
> pl> On 27 August 2010 00:09, Doug Barton <dougb at 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 commit it.
> pl>
> pl> Xin Li helped me with updating rc.conf.5 (thanks!).
> pl> It's included in attached patch.
> (snip)
> pl> >> + # ifconfig_IF_descr
> pl> >> + 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).
>
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.
--
wbr,
pluknet
P.S.
Google marks patches as (application/octet-stream). Bad Google.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: descr.rc.d.netif.patch
Type: application/octet-stream
Size: 1795 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20101119/154d80e0/descr.rc.d.netif.obj
More information about the freebsd-rc
mailing list