nfsd revision 184588
1#!/bin/sh
2#
3# $FreeBSD: head/etc/rc.d/nfsd 184588 2008-11-03 10:38:00Z dfr $
4#
5
6# PROVIDE: nfsd
7# REQUIRE: mountd hostname gssd
8# KEYWORD: nojail shutdown
9
10. /etc/rc.subr
11
12name="nfsd"
13rcvar=`set_rcvar nfs_server`
14command="/usr/sbin/${name}"
15
16load_rc_config $name
17command_args="${nfs_server_flags}"
18start_precmd="nfsd_precmd"
19sig_stop="USR1"
20
21nfsd_precmd()
22{
23	if ! sysctl vfs.nfsrv >/dev/null 2>&1; then
24		force_depend nfsserver || return 1
25	fi
26
27	if ! checkyesno rpcbind_enable  && \
28	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
29	then
30		force_depend rpcbind || return 1
31	fi
32
33	if ! checkyesno mountd_enable  && \
34	    ! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1
35	then
36		force_depend mountd || return 1
37	fi
38
39	if checkyesno nfs_reserved_port_only; then
40		echo 'NFS on reserved port only=YES'
41		sysctl vfs.nfsrv.nfs_privport=1 > /dev/null
42	fi
43	return 0
44}
45
46run_rc_command "$1"
47