7 # REQUIRE: mountd hostname gssd nfsuserd
8 # KEYWORD: nojail shutdown
13 rcvar="nfs_server_enable"
14 command="/usr/sbin/${name}"
17 start_precmd="nfsd_precmd"
22 if checkyesno oldnfs_server_enable; then
23 rc_flags="-o ${nfs_server_flags}"
25 # Load the module now, so that the vfs.nfsrv sysctl
29 if checkyesno nfs_reserved_port_only; then
30 echo 'NFS on reserved port only=YES'
31 sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
33 sysctl vfs.nfsrv.nfs_privport=0 > /dev/null
36 rc_flags="${nfs_server_flags}"
38 # Load the modules now, so that the vfs.nfsd sysctl
42 if checkyesno nfs_reserved_port_only; then
43 echo 'NFS on reserved port only=YES'
44 sysctl vfs.nfsd.nfs_privport=1 > /dev/null
46 sysctl vfs.nfsd.nfs_privport=0 > /dev/null
49 if checkyesno nfsv4_server_enable; then
50 sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
51 force_depend nfsuserd || err 1 "Cannot run nfsuserd"
53 echo 'NFSv4 is disabled'
54 sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
58 force_depend rpcbind || return 1
59 force_depend mountd || return 1