Comment 4 for bug 1524452

Revision history for this message
Ryan Harper (raharper) wrote :

Oi, this feels like it's been discussed before but, since there is no kernel object for eth1:1, udev won't emit a net-interface-add event, which is handled by /etc/init/network-interface.conf (which calls if up on the device).

/etc/init/networking.conf is responsible for the others and calls ifup -a (to hit the virtual interfaces). However, /etc/network/if-up.d/upstart includes query of which interfaces should already be up (ie, udev should have brought them up)

This script includes the following:

all_interfaces_up() {
        # return true if all interfaces listed in /etc/network/interfaces as 'auto'
        # are up. if no interfaces are found there, then "all [given] were up"
        local prefix="$1" iface=""
        for iface in $(get_auto_interfaces); do
                # if cur interface does is not up, then all have not been brought up
                [ -f "${prefix}${iface}" ] || return 1
        done
        return 0
}

and calls this:

get_auto_interfaces() {
        # write to stdout a list of interfaces configured as 'auto' in interfaces(5)
        local found=""
        # stderr redirected as it outputs things like:
        # Ignoring unknown interface eth0=eth0.
        found=$(ifquery --list --allow auto 2>/dev/null) || return
        set -- ${found}
        echo "$@"
}

ifquery --list --allow auto returns:
eth0
eth1
eth1:1
lo

However, /run/network/ifup.eth1:1 is not yet written since we're currently in the middle of an ifup for eth1:1.
It doesn't (to me) make sense to expect udev to bring up the virtual interfaces, thus the following filter applied to ifquery
resolves the blocking wait...

found=$(ifquery --list --allow auto 2>/dev/null | grep -v :) || return

drop the eth1:1 and it all boots fast and fine. /run/network has the correct files, eth1 and eth1:1 are up and assigned correctly.