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
|
2005-09-18 17:04:26 +00:00
|
|
|
rc_flags="${mountd_flags} -n"
|
2004-01-17 11:25:16 +00:00
|
|
|
fi
|
2004-01-17 11:31:15 +00:00
|
|
|
else
|
2004-01-17 11:25:16 +00:00
|
|
|
if checkyesno mountd_enable; then
|
2005-09-18 17:04:26 +00:00
|
|
|
checkyesno weak_mountd_authentication && rc_flags="-n"
|
2004-01-17 11:25:16 +00:00
|
|
|
fi
|
2004-01-17 11:31:15 +00:00
|
|
|
fi
|
2007-04-06 02:27:02 +00:00
|
|
|
|
|
|
|
if checkyesno zfs_enable ; then
|
|
|
|
rc_flags="${rc_flags} /etc/exports /etc/zfs/exports"
|
|
|
|
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"
|