From owner-freebsd-stable@FreeBSD.ORG Thu May 26 22:03:43 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C073E106564A for ; Thu, 26 May 2011 22:03:43 +0000 (UTC) (envelope-from william@palfreman.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.212.176]) by mx1.freebsd.org (Postfix) with ESMTP id A2DC18FC14 for ; Thu, 26 May 2011 22:03:43 +0000 (UTC) Received: by pxi11 with SMTP id 11so731962pxi.7 for ; Thu, 26 May 2011 15:03:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.30.7 with SMTP id o7mr546799pbh.75.1306445741240; Thu, 26 May 2011 14:35:41 -0700 (PDT) Received: by 10.68.66.231 with HTTP; Thu, 26 May 2011 14:35:41 -0700 (PDT) Date: Thu, 26 May 2011 23:35:41 +0200 Message-ID: From: William Palfreman To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: mountlate not late enough for nfe0 with dhcp X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 22:03:43 -0000 I find my nfe0 interface on my media server (an Acer Revo Atom) has not finished dhcp by the time /etc/rc.d/mountlate is run, or /etc/rc.d/mountcritremote. So the two NFS filesystems I want to mount cause booting to halt in the most inconvenient manner possible for a machine with no keyboard. I originally had this problem with mountcritremote, so I added the late option to /ett/fstab: nfshost:/share /nfs nfs rw,late 0 0 nfshost:/data /data nfs ro,late 0 0 But the network was still not up by the time /etc/rc.d/mountlate ran. So I slowed things down with the patch you can see below. I am not saying that you should add something so crude to the base system, but I do think that it would be better if failure to mount an NFS share due to DHCP not being finished did not cause the boot to halt. Non-root filesystem NFS mounts are rarely so critical that is it necessary to drop into single user mode instead - especially as these days many machines do not have a console continuously attached. It would be better just to retry mounting NFS in the background. Here's how I slow it down, anyway. Ten seconds seems to be plenty: $ diff -u /usr/src/etc/rc.d/mountlate /etc/rc.d/mountlate --- /usr/src/etc/rc.d/mountlate 2009-08-03 10:13:06.000000000 +0200 +++ /etc/rc.d/mountlate 2011-05-26 22:34:49.000000000 +0200 @@ -14,6 +14,13 @@ start_cmd="mountlate_start" stop_cmd=":" +ping -c1 -t1 8.8.8.8 > /dev/null +if [ $? -ne 0 ]; then + echo "Sleeping 10 waiting for network to come up" + sleep 10 + ping -c1 -t1 8.8.8.8 > /dev/null || echo "Network might still be down, pressing on" +fi + mountlate_start() { local err latefs @@ -40,8 +47,8 @@ ;; *) echo 'Mounting /etc/fstab filesystems failed,' \ - ' startup aborted' - stop_boot true + ' startup continuing' + stop_boot false ;; esac $ uname -a FreeBSD host.domain.com 8.2-STABLE FreeBSD 8.2-STABLE #0: Thu May 26 18:53:04 CEST 2011 root@host.domain.com:/usr/obj/usr/src/sys/TV amd64 [built from RELENG_8 as of a few days ago]