7 # REQUIRE: NETWORKING rpcbind quota mountlate
8 # KEYWORD: nojail shutdown
13 desc="Service remote NFS mount requests"
15 command="/usr/sbin/${name}"
16 pidfile="/var/run/${name}.pid"
17 required_files="/etc/exports"
18 start_precmd="mountd_precmd"
19 extra_commands="reload"
24 # Load the modules now, so that the vfs.nfsd sysctl
26 load_kld nfsd || return 1
28 # Do not force rpcbind to be running for an NFSv4 only server.
30 if checkyesno nfsv4_server_only; then
31 echo 'NFSv4 only server'
32 sysctl vfs.nfsd.server_min_nfsvers=4 > /dev/null
33 sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
34 rc_flags="${rc_flags} -R"
36 force_depend rpcbind || return 1
37 if checkyesno nfsv4_server_enable; then
38 sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
40 sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
44 # mountd flags will differ depending on rc.conf settings
46 if checkyesno nfs_server_enable || checkyesno nfsv4_server_only; then
47 if checkyesno weak_mountd_authentication; then
48 if checkyesno nfsv4_server_only; then
49 echo -n 'weak_mountd_authentication '
50 echo -n 'incompatible with nfsv4_server_only, '
53 rc_flags="${rc_flags} -n"
57 if checkyesno mountd_enable; then
58 checkyesno weak_mountd_authentication && rc_flags="-n"
62 if checkyesno zfs_enable; then
63 rc_flags="${rc_flags} /etc/exports /etc/zfs/exports"
66 rm -f /var/db/mountdtab
67 ( umask 022 ; > /var/db/mountdtab ) ||
68 err 1 'Cannot create /var/db/mountdtab'