From owner-freebsd-current@FreeBSD.ORG Wed Jul 6 19:47:46 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC69106564A; Wed, 6 Jul 2011 19:47:46 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3A3A18FC0C; Wed, 6 Jul 2011 19:47:45 +0000 (UTC) Received: by yxl31 with SMTP id 31so160673yxl.13 for ; Wed, 06 Jul 2011 12:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=S9UEnZmogMG+TWy1crpI9HjJSR21sJACp7IUcnHYI4M=; b=JoZPPueV4WIiu1msQfqGGUeaOA3Dl8DMgQsLkendZ0BVke9eC6OdZJJxVigQoh9+1r 7DjCMV/0CEvBmPFuvb1NI+jmNtkIk/x50xFt6WQmVKm53EZNtgKJqtfKfm+g1Q0o1kVc OiOjfaB3+Htk82070uXnuaDHdwLqbK9T+TCaw= MIME-Version: 1.0 Received: by 10.236.78.233 with SMTP id g69mr11468727yhe.298.1309981665332; Wed, 06 Jul 2011 12:47:45 -0700 (PDT) Received: by 10.236.203.6 with HTTP; Wed, 6 Jul 2011 12:47:45 -0700 (PDT) In-Reply-To: <44k4byunz2.fsf@lowell-desk.lan> References: <44k4byunz2.fsf@lowell-desk.lan> Date: Wed, 6 Jul 2011 21:47:45 +0200 Message-ID: From: "deeptech71@gmail.com" To: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: what is the RIGHT(TM) way to configure background DHCP? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 19:47:46 -0000 (i intend the discussion to take place primarily on the freebsd-hackers list, i'm CCing the freebsd-current list for a reason stated below.) (original first post: http://lists.freebsd.org/pipermail/freebsd-questions/2011-June/231301.html) On Mon, Jul 4, 2011 at 4:20 PM, Lowell Gilbert wrote: > You might want to try rewording your question, because it didn't make > any sense the first time. very well. though the question should have made perfect sense the first time. > [All of your examples were commented out, so > it was no surprise that they didn't work.] i chose to use # characters to separate rc.conf snippets from the other sentences i wrote. though perhaps #s were an unfortunate choice, because a # has a comment-begins-here meaning in rc.conf. in any case, "attempt 1" and "attempt 2" didn't work, but "attempt 3" did work, and that rules out the use of # for comments in rc.conf. now i will use "===== rc.conf snippet begins =====" and "===== rc.conf snippet ends =====" instead of # characters. > I considered trying to use my chrystal ball to guess that you needed > "SYNCDHCP" in your interface config, but you had obviously read the > manual for rc.conf(5), so that seemed unlikely... and "SYNCDHCP" makes things even worse. (i have no idea what "SYNCDHCP" is supposed to do, but in my experience:) "SYNCDHCP" makes the boot process wait until DHCP server replies before proceeding. "SYNCDHCP" is actually almost the same as "DHCP", except that "SYNCDHCP" waits indefinitely, while "DHCP" waits for at most defaultroute_delay, and also, "DHCP" gets "Starting network: lo0 sk0. " printed *before* the IP address assignment process starts, while "SYNCDHCP" gets "Starting network: lo0 sk0. " printed *after* the IP address assignment process finishes. so here is the question rephrased: the boot process of my FreeBSD machines takes a relatively long time. it spends 30 seconds idling at some point, because my network interface (sk0) is supposed to have an IP address assigned via DHCP, and the DHCP server on my LAN takes an extremely long time (~40 seconds) to reply to IP address requests. this is unacceptable for me; i want the FreeBSD boot process to finish 30 seconds earlier, even if i won't get the chance to use the network for ~40 seconds after the booting has finished. this was the actual case when my rc.conf had the following options related to network interfaces: ===== rc.conf snippet begins ===== ifconfig_sk0="DHCP" ===== rc.conf snippet ends ===== it took me 3 rc.conf configuration attempts to find a configuration in which the boot process does not idle for 30 seconds. the following was the first attempt: ===== rc.conf snippet begins ===== background_dhclient="YES" background_dhclient_sk0="YES" ===== rc.conf snippet ends ===== with this configuration, the DHCP client isn't even started. ie., the boot process does not idle at all (that's good!), but the network interface will never receive an IP address automatically (that's very bad!). here is the second attempt: ===== rc.conf snippet begins ===== ifconfig_sk0="DHCP" background_dhclient="YES" background_dhclient_sk0="YES" ===== rc.conf snippet ends ===== with this configuration, the DHCP client is started, but the boot process still idles for 30 seconds at some point (as if the background_dhclient and background_dhclient_ variables had no effect). the final attempt is: ===== rc.conf snippet begins ===== ifconfig_sk0="DHCP" defaultroute_delay="0" ===== rc.conf snippet ends ===== this configuration works, ie., during the boot process, there is no idling related to waiting for a DHCP server to reply. but this configuration looks hacky. so what is the RIGHT(TM) way to configure the boot process not to idle much in case of a slow DHCP server, and why? i ask this question partially because there is an rc.conf option background_dhclient (also, background_dhclient_), which doesn't seem to do anything, though it should, since it exists (either that, or the option should be removed). (there has been a recent discussion on the freebsd-current list about rc.d parallelization; [reason for CCing:] could recent rc.d changes have made the background_dhclient option useless?) i'd like to have an in-depth explanation on what effect should any combination of the following options should have on the boot process: defaultroute_delay="0", background_dhclient="YES", synchronous_dhclient="YES". (for example, using both background_dhclient="YES" and synchronous_dhclient="YES" seems stupid; i need a clarification if that's not the case.) what's the explanation if there is more than 1 network card (all of which are to have IP addresses assigned via DHCP)?