mountd revision 98184
178344Sobrien#!/bin/sh 278344Sobrien# 398184Sgordon# $NetBSD: mountd,v 1.11 2002/01/31 01:26:06 lukem Exp $ 498184Sgordon# $FreeBSD: head/etc/rc.d/mountd 98184 2002-06-13 22:14:37Z gordon $ 578344Sobrien# 678344Sobrien 778344Sobrien# PROVIDE: mountd 898184Sgordon# REQUIRE: NETWORKING mountall beforemountlkm nfsserver rpcbind quota 998184Sgordon# KEYWORD: FreeBSD NetBSD 1078344Sobrien 1178344Sobrien. /etc/rc.subr 1278344Sobrien 1378344Sobrienname="mountd" 1478344Sobrienrequired_files="/etc/exports" 1578344Sobrienstart_precmd="mountd_precmd" 1678344Sobrienextra_commands="reload" 1778344Sobrien 1898184Sgordoncase `${CMD_OSTYPE}` in 1998184SgordonFreeBSD) 2098184Sgordon rcvar=`set_rcvar nfs_server` 2198184Sgordon command="/sbin/${name}" 2298184Sgordon ;; 2398184SgordonNetBSD) 2498184Sgordon rcvar=`set_rcvar` 2598184Sgordon command="/usr/sbin/${name}" 2698184Sgordon ;; 2798184Sgordonesac 2898184Sgordon 2978344Sobrienmountd_precmd() 3078344Sobrien{ 3198184Sgordon case `${CMD_OSTYPE}` in 3298184Sgordon FreeBSD) 3398184Sgordon if ! sysctl vfs.nfsrv >/dev/null 2>&1; then 3498184Sgordon force_depend nfsserver || return 1 3598184Sgordon fi 3698184Sgordon if [ -z "`check_process rpcbind`" -a ! `checkyesno portmap_enable` ]; then 3798184Sgordon force_depend rpcbind || return 1 3898184Sgordon fi 3998184Sgordon 4098184Sgordon # mountd flags will differ depending on rc.conf settings 4198184Sgordon # 4298184Sgordon case ${nfs_server_enable} in 4398184Sgordon [Yy][Ee][Ss]) 4498184Sgordon if checkyesno weak_mountd_authentication ; then 4598184Sgordon mountd_flags="${mountd_flags} -n" 4698184Sgordon fi 4798184Sgordon ;; 4898184Sgordon *) 4998184Sgordon if checkyesno single_mountd_enable ; then 5098184Sgordon checkyesno weak_mountd_authentication && mountd_flags="-n" 5198184Sgordon fi 5298184Sgordon esac 5398184Sgordon ;; 5498184Sgordon esac 5578344Sobrien rm -f /var/db/mountdtab 5698184Sgordon ( umask 022 ; > /var/db/mountdtab ) 5778344Sobrien return 0 5878344Sobrien} 5978344Sobrien 6078344Sobrienload_rc_config $name 6178344Sobrienrun_rc_command "$1" 62