178344Sobrien#!/bin/sh 278344Sobrien# 398184Sgordon# $FreeBSD: releng/10.2/etc/rc.d/mountd 231667 2012-02-14 10:51:24Z dougb $ 478344Sobrien# 578344Sobrien 678344Sobrien# PROVIDE: mountd 7223852Srmacklem# REQUIRE: NETWORKING rpcbind quota 8180564Sdougb# KEYWORD: nojail shutdown 978344Sobrien 1078344Sobrien. /etc/rc.subr 1178344Sobrien 1278344Sobrienname="mountd" 13230099Sdougbrcvar="mountd_enable" 1499550Sgordoncommand="/usr/sbin/${name}" 15168681Smtmpidfile="/var/run/${name}.pid" 1678344Sobrienrequired_files="/etc/exports" 1778344Sobrienstart_precmd="mountd_precmd" 1878344Sobrienextra_commands="reload" 1978344Sobrien 2078344Sobrienmountd_precmd() 2178344Sobrien{ 22231667Sdougb force_depend rpcbind || return 1 23124627Smtm 24124627Smtm # mountd flags will differ depending on rc.conf settings 25124627Smtm # 26124628Smtm if checkyesno nfs_server_enable ; then 27124627Smtm if checkyesno weak_mountd_authentication; then 28150294Srodrigc rc_flags="${mountd_flags} -n" 2998184Sgordon fi 30124628Smtm else 31124627Smtm if checkyesno mountd_enable; then 32150294Srodrigc checkyesno weak_mountd_authentication && rc_flags="-n" 33124627Smtm fi 34124628Smtm fi 35168410Spjd 36221046Srmacklem # If oldnfs_server_enable is yes, force use of the old NFS server 37193354Srmacklem # 38221046Srmacklem if checkyesno oldnfs_server_enable; then 39221046Srmacklem rc_flags="-o ${rc_flags}" 40193354Srmacklem fi 41193354Srmacklem 42168685Spjd if checkyesno zfs_enable; then 43168410Spjd rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" 44168410Spjd fi 45168410Spjd 4678344Sobrien rm -f /var/db/mountdtab 47231667Sdougb ( umask 022 ; > /var/db/mountdtab ) || 48231667Sdougb err 1 'Cannot create /var/db/mountdtab' 4978344Sobrien} 5078344Sobrien 5178344Sobrienload_rc_config $name 5278344Sobrienrun_rc_command "$1" 53