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