mountd revision 126744
169783Smsmith#!/bin/sh
269783Smsmith#
369783Smsmith# $NetBSD: mountd,v 1.11 2002/01/31 01:26:06 lukem Exp $
469783Smsmith# $FreeBSD: head/etc/rc.d/mountd 126744 2004-03-08 12:25:05Z pjd $
569783Smsmith#
669783Smsmith
769783Smsmith# PROVIDE: mountd
869783Smsmith# REQUIRE: NETWORKING nfsserver rpcbind quota
969783Smsmith# KEYWORD: FreeBSD nojail
1069783Smsmith
1169783Smsmith. /etc/rc.subr
1269783Smsmith
1369783Smsmithname="mountd"
1469783Smsmithrcvar=`set_rcvar`
1569783Smsmithcommand="/usr/sbin/${name}"
1669783Smsmithrequired_files="/etc/exports"
1769783Smsmithstart_precmd="mountd_precmd"
1869783Smsmithextra_commands="reload"
1969783Smsmith
2069783Smsmithmountd_precmd()
2169783Smsmith{
2269783Smsmith	if ! checkyesno rpcbind_enable  && \
2369783Smsmith	    ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
2469783Smsmith	then
2569783Smsmith		force_depend rpcbind || return 1
2669783Smsmith	fi
2769783Smsmith
2869783Smsmith	# mountd flags will differ depending on rc.conf settings
2969783Smsmith	#
3069783Smsmith	if checkyesno nfs_server_enable ; then
3169783Smsmith		if checkyesno weak_mountd_authentication; then
3269783Smsmith			mountd_flags="${mountd_flags} -n"
3369783Smsmith		fi
3469783Smsmith	else
3569783Smsmith		if checkyesno mountd_enable; then
3669783Smsmith			checkyesno weak_mountd_authentication && mountd_flags="-n"
3769783Smsmith		fi
3869783Smsmith	fi
3969783Smsmith	rm -f /var/db/mountdtab
4069783Smsmith	( umask 022 ; > /var/db/mountdtab )
41107546Simp	return 0
42107546Simp}
43106844Smdodd
4469783Smsmithload_rc_config $name
4569783Smsmithrun_rc_command "$1"
4669783Smsmith