svn commit: r245525 - head/etc/rc.d

Bjoern A. Zeeb bz at FreeBSD.org
Thu Jan 17 09:57:43 UTC 2013


On Thu, 17 Jan 2013, Gleb Smirnoff wrote:

> On Thu, Jan 17, 2013 at 11:07:23AM +0900, Hiroki Sato wrote:
> H> bz> Author: bz
> H> bz> Date: Thu Jan 17 01:27:39 2013
> H> bz> New Revision: 245525
> H> bz> URL: http://svnweb.freebsd.org/changeset/base/245525
> H> bz>
> H> bz> Log:
> H> bz>   Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces.
> H> bz>   Do this per jail started, not per address.  This will allow DAD to complete
> H> bz>   and services to properly start.   Before we have seen problems with services
> H> bz>   trying to start before the IPv6 address was available to use and thus
> H> bz>   erroring and failing to start.
> H> bz>
> H> bz>   MFC after:	3 days
> H>
> H>  This may be too pedantic, but I think this delay should use
> H>  DupAddrDetectTransmits (net.inet6.ip6.dad_count).  The default value
> H>  of RETRANS_TIMER and MAX_RTR_SOLICITATION_DELAY in RFC 4861 is 1 sec,
> H>  so the theoretical delay value is (DupAddrDetectTransmits *
> H>  RETRANS_TIMER + MAX_RTR_SOLICITATION_DELAY).  The rc.d/netif script
> H>  uses this value (typically 2 seconds) for DAD.
> H>
> H>  I understand a simple 1 second delay works in practice, though.
>
> I'd prefer even a sleep loop that exits once address is avaialable. An
> example is in ports/net/zebra/files/zebra.sh.in.

That file doesn't seem to exist but a sleep loop is even worse unless
it's bound by the maximum time allowed possibly.  So we'd be down to
an extra second again.

The problem is that a) the second is too long already if you'd be
starting 300 jails, it's an extra 5 minutes of startup time.  b) the
shell script is supposed to go away as-is anyway, and c) in case of
duplicate address we are not failing either, so this is just "bandaid
for best effort and stop annoyance".

If you'd want to fix it perfectly you'd probably start adding all IP
addresses for all jails to start in one go, do the max wait time as
hrs explained or optimize that polling the interfaces and break out if
all are good (which will most likely take longer actually than sleep 2
for a larger number of jails), and then start all the jails.

/bz

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.


More information about the svn-src-all mailing list