1#!/bin/sh 2# 3# $FreeBSD: releng/10.2/etc/rc.d/mountd 231667 2012-02-14 10:51:24Z dougb $ 4# 5 6# PROVIDE: mountd 7# REQUIRE: NETWORKING rpcbind quota 8# KEYWORD: nojail shutdown 9 10. /etc/rc.subr 11 12name="mountd" 13rcvar="mountd_enable" 14command="/usr/sbin/${name}" 15pidfile="/var/run/${name}.pid" 16required_files="/etc/exports" 17start_precmd="mountd_precmd" 18extra_commands="reload" 19 20mountd_precmd() 21{ 22 force_depend rpcbind || return 1 23 24 # mountd flags will differ depending on rc.conf settings 25 # 26 if checkyesno nfs_server_enable ; then 27 if checkyesno weak_mountd_authentication; then 28 rc_flags="${mountd_flags} -n" 29 fi 30 else 31 if checkyesno mountd_enable; then 32 checkyesno weak_mountd_authentication && rc_flags="-n" 33 fi 34 fi 35 36 # If oldnfs_server_enable is yes, force use of the old NFS server 37 # 38 if checkyesno oldnfs_server_enable; then 39 rc_flags="-o ${rc_flags}" 40 fi 41 42 if checkyesno zfs_enable; then 43 rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" 44 fi 45 46 rm -f /var/db/mountdtab 47 ( umask 022 ; > /var/db/mountdtab ) || 48 err 1 'Cannot create /var/db/mountdtab' 49} 50 51load_rc_config $name 52run_rc_command "$1" 53