nfsd revision 302408
1#!/bin/sh 2# 3# $FreeBSD: stable/11/etc/rc.d/nfsd 298514 2016-04-23 16:10:54Z lme $ 4# 5 6# PROVIDE: nfsd 7# REQUIRE: mountd hostname gssd nfsuserd 8# KEYWORD: nojail shutdown 9 10. /etc/rc.subr 11 12name="nfsd" 13desc="Remote NFS server" 14rcvar="nfs_server_enable" 15command="/usr/sbin/${name}" 16 17load_rc_config $name 18start_precmd="nfsd_precmd" 19sig_stop="USR1" 20 21nfsd_precmd() 22{ 23 rc_flags="${nfs_server_flags}" 24 25 # Load the modules now, so that the vfs.nfsd sysctl 26 # oids are available. 27 load_kld nfsd 28 29 if checkyesno nfs_reserved_port_only; then 30 echo 'NFS on reserved port only=YES' 31 sysctl vfs.nfsd.nfs_privport=1 > /dev/null 32 else 33 sysctl vfs.nfsd.nfs_privport=0 > /dev/null 34 fi 35 36 if checkyesno nfsv4_server_enable || \ 37 checkyesno nfs_server_managegids; then 38 force_depend nfsuserd || err 1 "Cannot run nfsuserd" 39 fi 40 41 if checkyesno nfsv4_server_enable; then 42 sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null 43 else 44 echo 'NFSv4 is disabled' 45 sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null 46 fi 47 48 force_depend rpcbind || return 1 49 force_depend mountd || return 1 50} 51 52run_rc_command "$1" 53