Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/nfsd
#!/bin/sh | #!/bin/sh | ||||
# | # | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
# PROVIDE: nfsd | # PROVIDE: nfsd | ||||
# REQUIRE: mountcritremote mountd hostname gssd nfsuserd | # REQUIRE: mountcritremote mountd hostname gssd nfsuserd | ||||
# KEYWORD: nojail shutdown | # KEYWORD: nojail shutdown | ||||
. /etc/rc.subr | . /etc/rc.subr | ||||
name="nfsd" | name="nfsd" | ||||
desc="Remote NFS server" | desc="Remote NFS server" | ||||
rcvar="nfs_server_enable" | rcvar="nfs_server_enable" | ||||
command="/usr/sbin/${name}" | command="/usr/sbin/${name}" | ||||
nfs_server_vhost="" | |||||
load_rc_config $name | load_rc_config $name | ||||
start_precmd="nfsd_precmd" | start_precmd="nfsd_precmd" | ||||
sig_stop="USR1" | sig_stop="USR1" | ||||
nfsd_precmd() | nfsd_precmd() | ||||
{ | { | ||||
local _vhost | |||||
rc_flags="${nfs_server_flags}" | rc_flags="${nfs_server_flags}" | ||||
# Load the modules now, so that the vfs.nfsd sysctl | # Load the modules now, so that the vfs.nfsd sysctl | ||||
# oids are available. | # oids are available. | ||||
load_kld nfsd | load_kld nfsd | ||||
if checkyesno nfs_reserved_port_only; then | if checkyesno nfs_reserved_port_only; then | ||||
echo 'NFS on reserved port only=YES' | echo 'NFS on reserved port only=YES' | ||||
Show All 10 Lines | if checkyesno nfsv4_server_enable; then | ||||
sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null | sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null | ||||
else | else | ||||
echo 'NFSv4 is disabled' | echo 'NFSv4 is disabled' | ||||
sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null | sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null | ||||
fi | fi | ||||
force_depend rpcbind || return 1 | force_depend rpcbind || return 1 | ||||
force_depend mountd || return 1 | force_depend mountd || return 1 | ||||
if [ -n "${nfs_server_vhost}" ]; then | |||||
command_args="-V \"${nfs_server_vhost}\"" | |||||
fi | |||||
} | } | ||||
run_rc_command "$1" | run_rc_command "$1" |