libefivar: Fix wrong MLINKS.
[dragonfly.git] / etc / rc.d / nfsd
blob03d72fd2778c4d5e3889aebefe34d19ae2f81df0
1 #!/bin/sh
3 # $NetBSD: nfsd,v 1.4 2001/06/16 06:13:10 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/nfsd,v 1.9 2003/01/24 00:37:52 mtm Exp $
5 # $DragonFly: src/etc/rc.d/nfsd,v 1.5 2005/11/19 21:47:32 swildner Exp $
8 # PROVIDE: nfsd
9 # REQUIRE: mountd
10 # KEYWORD: shutdown
12 . /etc/rc.subr
14 name="nfsd"
15 rcvar=`set_rcvar nfs_server`
16 command="/sbin/${name}"
17 load_rc_config $name
18 command_args="${nfs_server_flags}"
19 start_precmd="nfsd_precmd"
20 sig_stop="USR1"
22 nfsd_precmd()
24 if ! sysctl vfs.nfs >/dev/null 2>&1; then
25 force_depend nfsserver || return 1
28 if ! checkyesno rpcbind_enable && \
29 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
30 then
31 force_depend rpcbind || return 1
34 if ! checkyesno mountd_enable && \
35 ! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1
36 then
37 force_depend mountd || return 1
40 if checkyesno nfs_reserved_port_only; then
41 echo 'NFS on reserved port only=YES'
42 sysctl vfs.nfs.nfs_privport=1 > /dev/null
44 return 0
47 run_rc_command "$1"