2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: nfsd
|
2009-06-02 22:15:47 +00:00
|
|
|
# REQUIRE: mountd hostname gssd nfsuserd
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="nfsd"
|
2002-06-13 22:14:37 +00:00
|
|
|
rcvar=`set_rcvar nfs_server`
|
2002-07-07 22:19:08 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2003-01-24 00:37:52 +00:00
|
|
|
load_rc_config $name
|
2004-01-17 10:59:43 +00:00
|
|
|
start_precmd="nfsd_precmd"
|
|
|
|
sig_stop="USR1"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
|
|
|
nfsd_precmd()
|
|
|
|
{
|
2009-06-02 22:15:47 +00:00
|
|
|
if checkyesno nfsv4_server_enable; then
|
|
|
|
# If nfsv4_server_enable is yes, force use
|
|
|
|
# of the experimental server
|
|
|
|
#
|
|
|
|
rc_flags="-e ${nfs_server_flags}"
|
|
|
|
|
|
|
|
if ! checkyesno nfsuserd_enable && \
|
|
|
|
! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend nfsuserd || return 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
rc_flags="${nfs_server_flags}"
|
|
|
|
|
|
|
|
if ! sysctl vfs.nfsrv >/dev/null 2>&1; then
|
|
|
|
force_depend nfsserver || return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if checkyesno nfs_reserved_port_only; then
|
|
|
|
echo 'NFS on reserved port only=YES'
|
|
|
|
sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
|
|
|
|
fi
|
2002-06-13 22:14:37 +00:00
|
|
|
fi
|
|
|
|
|
2002-08-14 05:44:32 +00:00
|
|
|
if ! checkyesno rpcbind_enable && \
|
|
|
|
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend rpcbind || return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! checkyesno mountd_enable && \
|
|
|
|
! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend mountd || return 1
|
|
|
|
fi
|
2002-06-13 22:14:37 +00:00
|
|
|
return 0
|
|
|
|
}
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
run_rc_command "$1"
|