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]
On 05/26/2011 14:35, William Palfreman wrote:> 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.If having DHCP up before proceeding is mission critical, set the synchronous_dhclient option in rc.conf. If you are satisfied with having the nfs mounts continue in the background, use that option in fstab. In the absence of those 2 clear indications from the admin as to what should happen, the current behavior is the right choice. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/
On Thu, May 26, 2011 at 11:35:41PM +0200, William Palfreman wrote:> 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.What's wrong with "rw,bg,intr" and "ro,bg,intr", respectively, in your situation? -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@volcano.org President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services
On Thu, May 26, 2011 at 11:35:41PM +0200, William Palfreman wrote:> 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. > > [snip]This has been discussed at length in the past, causing me to write an rc.d script to work around the problem. You can drop this script into /usr/local/etc/rc.d, chmod 755 it, and make use of it appropriately. The comments in the script should help you understand it. http://jdc.parodius.com/freebsd/netwait Example entries in rc.conf: netwait_enable="yes" netwait_ip="4.2.2.1 4.2.2.2" netwait_if="em0" I can point you to lengthy discussions on the mailing lists about this problem if need be, but they're from last year or the year before. They basically discuss the problem and are what caused me to write what I did. synchronous_dhcp might solve this problem for you as well, but I tend to recommend folks use netwait in more complex situations. A "simple sleep" is not 100% reliable and makes a lot of (bad) assumptions. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |
On Thu, May 26, 2011 at 04:14:47PM -0700, Jeremy Chadwick wrote:> synchronous_dhcp might solve this problem for you as well, but I tend to^^^^^^^^^^^^^^^^ This should have read synchronous_dhclient, sorry. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |