Add tip(1)'s emulation of cu(1) to tip's manual page.
[dragonfly.git] / etc / rc.d / nfsd
1 #!/bin/sh
2 #
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.4 2004/01/27 00:42:45 rob Exp $
6 #
7
8 # PROVIDE: nfsd
9 # REQUIRE: mountd
10 # KEYWORD: DragonFly
11
12 . /etc/rc.subr
13
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"
21
22 nfsd_precmd()
23 {
24         if ! sysctl vfs.nfs >/dev/null 2>&1; then
25                 force_depend nfsserver || return 1
26         fi
27
28         if ! checkyesno rpcbind_enable  && \
29             ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
30         then
31                 force_depend rpcbind || return 1
32         fi
33
34         if ! checkyesno mountd_enable  && \
35             ! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1
36         then
37                 force_depend mountd || return 1
38         fi
39
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
43         fi
44         return 0
45 }
46
47 run_rc_command "$1"