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
|
2002-06-13 22:14:37 +00:00
|
|
|
# REQUIRE: NETWORKING mountall beforemountlkm nfsserver rpcbind quota
|
|
|
|
# KEYWORD: FreeBSD NetBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="mountd"
|
|
|
|
required_files="/etc/exports"
|
|
|
|
start_precmd="mountd_precmd"
|
|
|
|
extra_commands="reload"
|
|
|
|
|
2002-06-13 22:14:37 +00:00
|
|
|
case `${CMD_OSTYPE}` in
|
|
|
|
FreeBSD)
|
|
|
|
rcvar=`set_rcvar nfs_server`
|
|
|
|
command="/sbin/${name}"
|
|
|
|
;;
|
|
|
|
NetBSD)
|
|
|
|
rcvar=`set_rcvar`
|
|
|
|
command="/usr/sbin/${name}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2001-06-16 07:16:14 +00:00
|
|
|
mountd_precmd()
|
|
|
|
{
|
2002-06-13 22:14:37 +00:00
|
|
|
case `${CMD_OSTYPE}` in
|
|
|
|
FreeBSD)
|
|
|
|
if ! sysctl vfs.nfsrv >/dev/null 2>&1; then
|
|
|
|
force_depend nfsserver || return 1
|
|
|
|
fi
|
|
|
|
if [ -z "`check_process rpcbind`" -a ! `checkyesno portmap_enable` ]; then
|
|
|
|
force_depend rpcbind || return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# mountd flags will differ depending on rc.conf settings
|
|
|
|
#
|
|
|
|
case ${nfs_server_enable} in
|
|
|
|
[Yy][Ee][Ss])
|
|
|
|
if checkyesno weak_mountd_authentication ; then
|
|
|
|
mountd_flags="${mountd_flags} -n"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if checkyesno single_mountd_enable ; then
|
|
|
|
checkyesno weak_mountd_authentication && mountd_flags="-n"
|
|
|
|
fi
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
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"
|