Page MenuHomeFreeBSD

Modify the rc scripts so that mountd starts after mountlate
ClosedPublic

Authored by rmacklem on Dec 3 2021, 11:49 PM.
Tags
Referenced Files
F106122720: D33256.diff
Wed, Dec 25, 6:59 PM
Unknown Object (File)
Tue, Dec 24, 4:32 PM
Unknown Object (File)
Wed, Dec 18, 6:21 PM
Unknown Object (File)
Sat, Dec 7, 8:46 PM
Unknown Object (File)
Fri, Dec 6, 12:27 PM
Unknown Object (File)
Nov 14 2024, 4:28 AM
Unknown Object (File)
Oct 5 2024, 8:31 PM
Unknown Object (File)
Oct 5 2024, 6:05 PM
Subscribers

Details

Summary

PR#254282 reports a problem where nullfs mounts cannot be
exported via mountd for FreeBSD 13.0.

The problem seems to be that, to do the nullfs mounts in
/etc/fstab, they require the "late" mount option, so that the
underlying filesystem is mounted (ZFS for the PR).

Adding "mountlate" to the REQUIRE list in /etc/rc.d/mountd
fixes the problem, but that results in a dependency cycle
because /etc/rc.d/lockd specifies:

  1. REQUIRE: nfsd
  2. BEFORE: DAEMON

--> which forces mountd to preceed DAEMON.

I think I know why lockd specifies:

BEFORE: DAEMON

--> I suspect that some daemon requires file locking and that

requires lockd to be running, for an NFS mounted root fs.

but I do not see any reason that lockd/statd must start after nfsd.
(This # REQUIRE has been in the scripts since they were imported
from NetBSD long long ago.)

This patch makes mountd start after mountlate, without any dependency
cycle.

Test Plan

Seems to work fine for me for both NFS client and server setups.
I also tested a kernel with no NFS options, to make sure that the
modules are loaded soon enough.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Jan 23 2022, 10:18 PM
This revision was automatically updated to reflect the committed changes.