7 # REQUIRE: mountd hostname gssd nfsuserd
8 # KEYWORD: nojail shutdown
13 rcvar=`set_rcvar nfs_server`
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 if ! checkyesno nfsuserd_enable && \
52 ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1
54 if ! force_depend nfsuserd; then
55 err 1 "Cannot run nfsuserd"
59 echo 'NFSv4 is disabled'
60 sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
64 if ! checkyesno rpcbind_enable && \
65 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
67 force_depend rpcbind || return 1
70 if ! checkyesno mountd_enable && \
71 ! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1
73 force_depend mountd || return 1