Merge from vendor branch LIBARCHIVE:
[dragonfly.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: src/etc/rc.d/mountd,v 1.9 2002/10/12 10:31:31 schweikh Exp $
5 # $DragonFly: src/etc/rc.d/mountd,v 1.6 2005/11/19 21:47:32 swildner Exp $
6 #
7
8 # PROVIDE: mountd
9 # REQUIRE: NETWORKING mountcritremote nfsserver rpcbind quota
10
11 . /etc/rc.subr
12
13 name="mountd"
14 rcvar=`set_rcvar`
15 command="/sbin/${name}"
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         # mountd flags will differ depending on rc.conf settings
28         #
29         case ${nfs_server_enable} in
30         [Yy][Ee][Ss])
31                 if checkyesno weak_mountd_authentication; then
32                         mountd_flags="${mountd_flags} -n"
33                 fi
34                 ;;
35         *)
36                 if checkyesno mountd_enable; then
37                         checkyesno weak_mountd_authentication && mountd_flags="-n"
38                 fi
39         esac
40         rm -f /var/db/mountdtab
41         ( umask 022 ; > /var/db/mountdtab )
42         return 0
43 }
44
45 load_rc_config $name
46 run_rc_command "$1"