2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: mountd
|
2011-07-08 00:49:50 +00:00
|
|
|
# REQUIRE: NETWORKING rpcbind quota
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="mountd"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="mountd_enable"
|
2002-07-07 22:19:08 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2007-04-13 06:42:25 +00:00
|
|
|
pidfile="/var/run/${name}.pid"
|
2001-06-16 07:16:14 +00:00
|
|
|
required_files="/etc/exports"
|
|
|
|
start_precmd="mountd_precmd"
|
|
|
|
extra_commands="reload"
|
|
|
|
|
|
|
|
mountd_precmd()
|
|
|
|
{
|
2012-02-14 10:51:24 +00:00
|
|
|
force_depend rpcbind || return 1
|
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
|
|
|
|
2011-04-26 00:22:17 +00:00
|
|
|
# If oldnfs_server_enable is yes, force use of the old NFS server
|
2009-06-02 22:15:47 +00:00
|
|
|
#
|
2011-04-26 00:22:17 +00:00
|
|
|
if checkyesno oldnfs_server_enable; then
|
|
|
|
rc_flags="-o ${rc_flags}"
|
2009-06-02 22:15:47 +00:00
|
|
|
fi
|
|
|
|
|
2007-04-13 10:29:25 +00:00
|
|
|
if checkyesno zfs_enable; then
|
2007-04-06 02:27:02 +00:00
|
|
|
rc_flags="${rc_flags} /etc/exports /etc/zfs/exports"
|
|
|
|
fi
|
|
|
|
|
2001-06-16 07:16:14 +00:00
|
|
|
rm -f /var/db/mountdtab
|
2012-02-14 10:51:24 +00:00
|
|
|
( umask 022 ; > /var/db/mountdtab ) ||
|
|
|
|
err 1 'Cannot create /var/db/mountdtab'
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|