1#!/bin/sh 2# 3# $NetBSD: nfslocking,v 1.6 2002/03/24 15:52:41 lukem Exp $
| 1#!/bin/sh 2# 3# $NetBSD: nfslocking,v 1.6 2002/03/24 15:52:41 lukem Exp $
|
4# $FreeBSD: head/etc/rc.d/statd 171871 2007-08-17 07:58:26Z mtm $
| 4# FreeBSD History: src/etc/rc.d/nfslocking,v 1.11 2004/10/07 13:55:26 mtm Exp 5# $FreeBSD: head/etc/rc.d/statd 171881 2007-08-18 04:08:53Z mtm $
|
5# 6
| 6# 7
|
7# PROVIDE: nfslocking
| 8# PROVIDE: statd
|
8# REQUIRE: nfsserver nfsclient nfsd rpcbind 9# BEFORE: DAEMON 10# KEYWORD: nojail 11 12. /etc/rc.subr 13
| 9# REQUIRE: nfsserver nfsclient nfsd rpcbind 10# BEFORE: DAEMON 11# KEYWORD: nojail 12 13. /etc/rc.subr 14
|
14# Save the (one) commandline argument in case it gets clobbered. 15arg=$1
| 15name="statd" 16rcvar=rpc_statd_enable 17command="/usr/sbin/rpc.${name}" 18start_precmd='statd_precmd' 19stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable' 20status_precmd=$stop_precmd
|
16
| 21
|
17# Either NFS client or server must be enabled and rpcbind(8) must be started.
| 22# Make sure that we are either an NFS client or server, and that we get 23# the correct flags from rc.conf(5).
|
18#
| 24#
|
19nfslocking_precmd()
| 25statd_precmd()
|
20{ 21 local ret 22 ret=0 23 24 if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable 25 then 26 ret=1 27 fi 28 if ! checkyesno rpcbind_enable && \ 29 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 30 then 31 force_depend rpcbind || ret=1 32 fi 33 rc_flags=${rpc_statd_flags} 34 return ${ret} 35} 36 37load_rc_config $name 38run_rc_command $1
| 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_statd_flags} 40 return ${ret} 41} 42 43load_rc_config $name 44run_rc_command $1
|