]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - 6/etc/rc.d/mountd
Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
[FreeBSD/FreeBSD.git] / 6 / etc / rc.d / mountd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: mountd
7 # REQUIRE: NETWORKING nfsserver rpcbind quota
8 # KEYWORD: nojail
9
10 . /etc/rc.subr
11
12 name="mountd"
13 rcvar=`set_rcvar`
14 command="/usr/sbin/${name}"
15 pidfile="/var/run/${name}.pid"
16 required_files="/etc/exports"
17 start_precmd="mountd_precmd"
18 extra_commands="reload"
19
20 mountd_precmd()
21 {
22         if ! checkyesno rpcbind_enable  && \
23             ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
24         then
25                 force_depend rpcbind || return 1
26         fi
27
28         # mountd flags will differ depending on rc.conf settings
29         #
30         if checkyesno nfs_server_enable ; then
31                 if checkyesno weak_mountd_authentication; then
32                         rc_flags="${mountd_flags} -n"
33                 fi
34         else
35                 if checkyesno mountd_enable; then
36                         checkyesno weak_mountd_authentication && rc_flags="-n"
37                 fi
38         fi
39         rm -f /var/db/mountdtab
40         ( umask 022 ; > /var/db/mountdtab )
41         return 0
42 }
43
44 load_rc_config $name
45 run_rc_command "$1"