nfsd revision 101851
1#!/bin/sh 2# 3# $NetBSD: nfsd,v 1.4 2001/06/16 06:13:10 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/nfsd 101851 2002-08-14 05:44:32Z gordon $ 5# 6 7# PROVIDE: nfsd 8# REQUIRE: mountd 9# KEYWORD: FreeBSD NetBSD 10 11. /etc/rc.subr 12 13name="nfsd" 14rcvar=`set_rcvar nfs_server` 15command="/usr/sbin/${name}" 16 17case `${CMD_OSTYPE}` in 18FreeBSD) 19 command_args="${nfs_server_flags}" 20 start_precmd="nfsd_precmd" 21 ;; 22NetBSD) 23 required_vars="mountd rpcbind" 24 start_precmd= 25 ;; 26esac 27 28nfsd_precmd() 29{ 30 if ! sysctl vfs.nfsrv >/dev/null 2>&1; then 31 force_depend nfsserver || return 1 32 fi 33 34 if ! checkyesno rpcbind_enable && \ 35 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 36 then 37 force_depend rpcbind || return 1 38 fi 39 40 if ! checkyesno mountd_enable && \ 41 ! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1 42 then 43 force_depend mountd || return 1 44 fi 45 46 if checkyesno nfs_reserved_port_only ; then 47 echo -n ' NFS on reserved port only=YES' 48 sysctl vfs.nfsrv.nfs_privport=1 > /dev/null 49 fi 50 return 0 51} 52 53load_rc_config $name 54run_rc_command "$1" 55