lockd revision 171881
1201526Sobrien#!/bin/sh 2201526Sobrien# 3201526Sobrien# $NetBSD: nfslocking,v 1.6 2002/03/24 15:52:41 lukem Exp $ 4# FreeBSD History: src/etc/rc.d/nfslocking,v 1.11 2004/10/07 13:55:26 mtm 5# $FreeBSD: head/etc/rc.d/lockd 171881 2007-08-18 04:08:53Z mtm $ 6# 7 8# PROVIDE: lockd 9# REQUIRE: nfsserver nfsclient nfsd rpcbind 10# BEFORE: DAEMON 11# KEYWORD: nojail 12 13. /etc/rc.subr 14 15name="lockd" 16rcvar=rpc_lockd_enable 17command="/usr/sbin/rpc.${name}" 18start_precmd='lockd_precmd' 19stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable' 20status_precmd=$stop_precmd 21 22# Make sure that we are either an NFS client or server, and that we get 23# the correct flags from rc.conf(5). 24# 25lockd_precmd() 26{ 27 local ret 28 ret=0 29 30 if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable 31 then 32 ret=1 33 fi 34 if ! checkyesno rpcbind_enable && \ 35 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 36 then 37 force_depend rpcbind || ret=1 38 fi 39 rc_flags=${rpc_lockd_flags} 40 return ${ret} 41} 42 43load_rc_config $name 44run_rc_command $1 45