Author: bz
Date: Thu Apr 11 22:04:19 2013
New Revision: 249387
URL: http://svnweb.freebsd.org/changeset/base/249387

Log:
  MFC r245525:
  
    Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces.
    Do this per jail started, not per address.  This will allow DAD to complete
    and services to properly start.   Before we have seen problems with services
    trying to start before the IPv6 address was available to use and thus
    erroring and failing to start.

Modified:
  stable/9/etc/rc.d/jail
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/rc.d/jail
==============================================================================
--- stable/9/etc/rc.d/jail      Thu Apr 11 22:02:35 2013        (r249386)
+++ stable/9/etc/rc.d/jail      Thu Apr 11 22:04:19 2013        (r249387)
@@ -509,7 +509,7 @@ jail_handle_ips_option()
                esac
                case "${_type}" in
                inet)   ;;
-               inet6)  ;;
+               inet6)  ipv6_address_count=$((ipv6_address_count + 1)) ;;
                *)      warn "Could not determine address family.  Not going" \
                            "to ${_action} address '${_addr}' for ${_jail}."
                        continue
@@ -546,6 +546,7 @@ jail_ips()
        esac
 
        # Handle addresses.
+       ipv6_address_count=0
        jail_handle_ips_option ${_action} "${_ip}"
        # Handle jail_xxx_ip_multi<N>
        alias=0
@@ -558,6 +559,12 @@ jail_ips()
                        ;;
                esac
        done
+       case ${ipv6_address_count} in
+       0)      ;;
+       *)      # Sleep 1 second to let DAD complete before starting services.
+               sleep 1
+               ;;
+       esac
 }
 
 jail_prestart()
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to