2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: mountd,v 1.11 2002/01/31 01:26:06 lukem Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: mountd
|
2004-03-05 07:43:38 +00:00
|
|
|
# REQUIRE: NETWORKING nfsserver rpcbind quota
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="mountd"
|
2002-08-14 05:44:32 +00:00
|
|
|
rcvar=`set_rcvar`
|
2002-07-07 22:19:08 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2001-06-16 07:16:14 +00:00
|
|
|
required_files="/etc/exports"
|
|
|
|
start_precmd="mountd_precmd"
|
|
|
|
extra_commands="reload"
|
|
|
|
|
|
|
|
mountd_precmd()
|
|
|
|
{
|
2004-01-17 11:25:16 +00:00
|
|
|
if ! checkyesno rpcbind_enable && \
|
|
|
|
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend rpcbind || return 1
|
|
|
|
fi
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2004-01-17 11:25:16 +00:00
|
|
|
# mountd flags will differ depending on rc.conf settings
|
|
|
|
#
|
2004-01-17 11:31:15 +00:00
|
|
|
if checkyesno nfs_server_enable ; then
|
2004-01-17 11:25:16 +00:00
|
|
|
if checkyesno weak_mountd_authentication; then
|
|
|
|
mountd_flags="${mountd_flags} -n"
|
|
|
|
fi
|
2004-01-17 11:31:15 +00:00
|
|
|
else
|
2004-01-17 11:25:16 +00:00
|
|
|
if checkyesno mountd_enable; then
|
|
|
|
checkyesno weak_mountd_authentication && mountd_flags="-n"
|
|
|
|
fi
|
2004-01-17 11:31:15 +00:00
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
rm -f /var/db/mountdtab
|
2002-06-13 22:14:37 +00:00
|
|
|
( umask 022 ; > /var/db/mountdtab )
|
2001-06-16 07:16:14 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|