Unconditional 30s boot delay.

From: Ian FREISLICH <ianf_at_clue.co.za>
Date: Wed, 28 May 2008 08:25:50 +0200
Hi

Recently my systems using DHCP have introduced an unconditional 30 second delay in the boot-up time.  The cause is this:

/etc/rc.d/routing:
routing_start()
{
        static_start
        options_start

        # Return without waiting if we don't have dhcp interfaces.
        # Once we can test that the link is actually up, we should
        # remove this test and always wait.
        dhcp_interfaces=`list_net_interfaces dhcp`
        [ -z "`list_net_interfaces dhcp`" ] && return

        # Wait for a default route
        delay=${if_up_delay}
        while [ ${delay} -gt 0 ]; do
                defif=`get_default_if -inet`
                if [ -n "${defif}" ]; then
                        if [ ${delay} -ne ${if_up_delay} ]; then
                                echo "($defif)"
                        fi
                        break
                fi
                if [ ${delay} -eq ${if_up_delay} ]; then
                        echo -n "Waiting ${delay}s for an interface to come up: "
                else
                        echo -n .
                fi
                sleep 1
                delay=`expr $delay - 1`
        done
}

Which is fine and well if routing runs *after* the DHCP request,
but it doesn't it runs before devd is started so the default route
from DHCP is never acquired and we wait... for 30s....

And this needs an "echo" after the "done" so that the next script's
output lands up at the start of the next line.

Ian

--
Ian Freislich
Received on Wed May 28 2008 - 04:26:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:31 UTC