[RFC] ifconfig description support in rc.d
Hiroki Sato
hrs at FreeBSD.org
Mon Oct 11 10:29:44 UTC 2010
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).
-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20101011/91445ace/attachment.pgp
More information about the freebsd-current
mailing list