]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/mountd
This commit was generated by cvs2svn to compensate for changes in r171169,
[FreeBSD/FreeBSD.git] / etc / rc.d / mountd
1 #!/bin/sh
2 #
3 # $NetBSD: mountd,v 1.11 2002/01/31 01:26:06 lukem Exp $
4 # $FreeBSD$
5 #
6
7 # PROVIDE: mountd
8 # REQUIRE: NETWORKING nfsserver rpcbind quota
9 # KEYWORD: nojail
10
11 . /etc/rc.subr
12
13 name="mountd"
14 rcvar=`set_rcvar`
15 command="/usr/sbin/${name}"
16 pidfile="/var/run/${name}.pid"
17 required_files="/etc/exports"
18 start_precmd="mountd_precmd"
19 extra_commands="reload"
20
21 mountd_precmd()
22 {
23         if ! checkyesno rpcbind_enable  && \
24             ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
25         then
26                 force_depend rpcbind || return 1
27         fi
28
29         # mountd flags will differ depending on rc.conf settings
30         #
31         if checkyesno nfs_server_enable ; then
32                 if checkyesno weak_mountd_authentication; then
33                         rc_flags="${mountd_flags} -n"
34                 fi
35         else
36                 if checkyesno mountd_enable; then
37                         checkyesno weak_mountd_authentication && rc_flags="-n"
38                 fi
39         fi
40
41         if checkyesno zfs_enable; then
42                 rc_flags="${rc_flags} /etc/exports /etc/zfs/exports"
43         fi
44
45         rm -f /var/db/mountdtab
46         ( umask 022 ; > /var/db/mountdtab )
47         return 0
48 }
49
50 load_rc_config $name
51 run_rc_command "$1"