]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - etc/rc.d/nfsd
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / etc / rc.d / nfsd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: nfsd
7 # REQUIRE: mountd
8 # KEYWORD: nojail shutdown
9
10 . /etc/rc.subr
11
12 name="nfsd"
13 rcvar=`set_rcvar nfs_server`
14 command="/usr/sbin/${name}"
15
16 load_rc_config $name
17 command_args="${nfs_server_flags}"
18 start_precmd="nfsd_precmd"
19 sig_stop="USR1"
20
21 nfsd_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
46 run_rc_command "$1"