mountd revision 124628
1#!/bin/sh
2#
3# $NetBSD: mountd,v 1.11 2002/01/31 01:26:06 lukem Exp $
4# $FreeBSD: head/etc/rc.d/mountd 124628 2004-01-17 11:31:15Z mtm $
5#
6
7# PROVIDE: mountd
8# REQUIRE: NETWORKING mountall beforemountlkm nfsserver rpcbind quota
9# KEYWORD: FreeBSD
10
11. /etc/rc.subr
12
13name="mountd"
14rcvar=`set_rcvar`
15command="/usr/sbin/${name}"
16required_files="/etc/exports"
17start_precmd="mountd_precmd"
18extra_commands="reload"
19
20mountd_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			mountd_flags="${mountd_flags} -n"
33		fi
34	else
35		if checkyesno mountd_enable; then
36			checkyesno weak_mountd_authentication && mountd_flags="-n"
37		fi
38	fi
39	rm -f /var/db/mountdtab
40	( umask 022 ; > /var/db/mountdtab )
41	return 0
42}
43
44load_rc_config $name
45run_rc_command "$1"
46