1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $NetBSD: mountd,v 1.6 2000/06/02 22:54:11 fvdl Exp $
| 3# $NetBSD: mountd,v 1.11 2002/01/31 01:26:06 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/mountd 98184 2002-06-13 22:14:37Z gordon $
|
4# 5 6# PROVIDE: mountd
| 5# 6 7# PROVIDE: mountd
|
7# REQUIRE: NETWORK mountall beforemountlkm rpcbind quota
| 8# REQUIRE: NETWORKING mountall beforemountlkm nfsserver rpcbind quota 9# KEYWORD: FreeBSD NetBSD
|
8 9. /etc/rc.subr 10 11name="mountd"
| 10 11. /etc/rc.subr 12 13name="mountd"
|
12rcvar="nfs_server" 13command="/usr/sbin/${name}"
| |
14required_files="/etc/exports" 15start_precmd="mountd_precmd" 16extra_commands="reload" 17
| 14required_files="/etc/exports" 15start_precmd="mountd_precmd" 16extra_commands="reload" 17
|
| 18case `${CMD_OSTYPE}` in 19FreeBSD) 20 rcvar=`set_rcvar nfs_server` 21 command="/sbin/${name}" 22 ;; 23NetBSD) 24 rcvar=`set_rcvar` 25 command="/usr/sbin/${name}" 26 ;; 27esac 28
|
18mountd_precmd() 19{
| 29mountd_precmd() 30{
|
| 31 case `${CMD_OSTYPE}` in 32 FreeBSD) 33 if ! sysctl vfs.nfsrv >/dev/null 2>&1; then 34 force_depend nfsserver || return 1 35 fi 36 if [ -z "`check_process rpcbind`" -a ! `checkyesno portmap_enable` ]; then 37 force_depend rpcbind || return 1 38 fi 39 40 # mountd flags will differ depending on rc.conf settings 41 # 42 case ${nfs_server_enable} in 43 [Yy][Ee][Ss]) 44 if checkyesno weak_mountd_authentication ; then 45 mountd_flags="${mountd_flags} -n" 46 fi 47 ;; 48 *) 49 if checkyesno single_mountd_enable ; then 50 checkyesno weak_mountd_authentication && mountd_flags="-n" 51 fi 52 esac 53 ;; 54 esac
|
20 rm -f /var/db/mountdtab
| 55 rm -f /var/db/mountdtab
|
21 echo -n > /var/db/mountdtab
| 56 ( umask 022 ; > /var/db/mountdtab )
|
22 return 0 23} 24 25load_rc_config $name 26run_rc_command "$1"
| 57 return 0 58} 59 60load_rc_config $name 61run_rc_command "$1"
|