NFS - DNS fail stops boot in mountlate

Jeremy Chadwick freebsd at
Fri Jan 7 02:35:09 UTC 2011

On Thu, Jan 06, 2011 at 09:19:06PM -0500, grarpamp wrote:
> So what was unclear?
> mount_nfs emits a nonzero exit status upon failing to look
> up an FQDN causing mountlate to trigger a dump to shell
> on boot during rc processing. That's a *showstopper*. The
> right thing to do is to hack mount_nfs to punt to background
> mounting in this case with an appropriate exit status.
> Personally I'd distinguish mount_nfs exit codes between:
> 0 - mounted
> 1 - backgrounded, for any reason
> 2 - none of the above
> and adjust the rc's to deal with it accordingly.
> Words are subject to interpretation and take time. Though
> perhaps masked by brevity, I believe all the above elements
> were in the prior concise post. Thanks everybody :)

So basically the problem is that the "bg" option in mount_nfs only
applies to "network unreachable" conditions and not "DNS resolution
failed" conditions.

Initially I was going to refute the above request until I looked closely
at the mount_nfs(8) man page which has the following clauses:

	For non-critical file systems, the bg and retrycnt options
	provide mechanisms to prevent the boot process from hanging
	if the server is unavailable.

	[...describing the "bg" option...]

	Useful for fstab(5), where the file system mount is not
	critical to multiuser operation.

I read these statements to mean "if -o bg is used, the system should not
hang/stall/fail during the boot process".  Dumping to /bin/sh on boot as
a result of a DNS lookup failure violates those statements, IMHO.

I would agree that DNS resolution should be part of the bg/retry feature
of "bg" in mount_nfs.  How/whether this is feasible to implement is
unknown to me.

| Jeremy Chadwick                                   jdc at |
| Parodius Networking              |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP 4BD6C0CB |

More information about the freebsd-stable mailing list