7 # REQUIRE: mountcritremote mountd hostname gssd nfsuserd
8 # KEYWORD: nojail shutdown
13 desc="Remote NFS server"
14 rcvar="nfs_server_enable"
15 command="/usr/sbin/${name}"
19 start_precmd="nfsd_precmd"
25 rc_flags="${nfs_server_flags}"
27 # Load the modules now, so that the vfs.nfsd sysctl
31 if checkyesno nfs_reserved_port_only; then
32 echo 'NFS on reserved port only=YES'
33 sysctl vfs.nfsd.nfs_privport=1 > /dev/null
35 sysctl vfs.nfsd.nfs_privport=0 > /dev/null
38 if checkyesno nfs_server_managegids; then
39 force_depend nfsuserd || err 1 "Cannot run nfsuserd"
42 if checkyesno nfsv4_server_enable; then
43 sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
45 echo 'NFSv4 is disabled'
46 sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
49 force_depend rpcbind || return 1
50 force_depend mountd || return 1
51 if [ -n "${nfs_server_vhost}" ]; then
52 command_args="-V \"${nfs_server_vhost}\""