178344Sobrien#!/bin/sh 278344Sobrien# 398184Sgordon# $FreeBSD: releng/11.0/etc/rc.d/mountd 298514 2016-04-23 16:10:54Z lme $ 478344Sobrien# 578344Sobrien 678344Sobrien# PROVIDE: mountd 7223852Srmacklem# REQUIRE: NETWORKING rpcbind quota 8180564Sdougb# KEYWORD: nojail shutdown 978344Sobrien 1078344Sobrien. /etc/rc.subr 1178344Sobrien 1278344Sobrienname="mountd" 13298514Slmedesc="Service remote NFS mount requests" 14230099Sdougbrcvar="mountd_enable" 1599550Sgordoncommand="/usr/sbin/${name}" 16168681Smtmpidfile="/var/run/${name}.pid" 1778344Sobrienrequired_files="/etc/exports" 1878344Sobrienstart_precmd="mountd_precmd" 1978344Sobrienextra_commands="reload" 2078344Sobrien 2178344Sobrienmountd_precmd() 2278344Sobrien{ 23231667Sdougb force_depend rpcbind || return 1 24124627Smtm 25124627Smtm # mountd flags will differ depending on rc.conf settings 26124627Smtm # 27124628Smtm if checkyesno nfs_server_enable ; then 28124627Smtm if checkyesno weak_mountd_authentication; then 29150294Srodrigc rc_flags="${mountd_flags} -n" 3098184Sgordon fi 31124628Smtm else 32124627Smtm if checkyesno mountd_enable; then 33150294Srodrigc checkyesno weak_mountd_authentication && rc_flags="-n" 34124627Smtm fi 35124628Smtm fi 36168410Spjd 37168685Spjd if checkyesno zfs_enable; then 38168410Spjd rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" 39168410Spjd fi 40168410Spjd 4178344Sobrien rm -f /var/db/mountdtab 42231667Sdougb ( umask 022 ; > /var/db/mountdtab ) || 43231667Sdougb err 1 'Cannot create /var/db/mountdtab' 4478344Sobrien} 4578344Sobrien 4678344Sobrienload_rc_config $name 4778344Sobrienrun_rc_command "$1" 48