2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2007-08-18 04:08:53 +00:00
|
|
|
# FreeBSD History: src/etc/rc.d/nfslocking,v 1.11 2004/10/07 13:55:26 mtm
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
2007-08-18 04:08:53 +00:00
|
|
|
# PROVIDE: lockd
|
2007-09-03 02:02:31 +00:00
|
|
|
# REQUIRE: nfsserver nfsclient nfsd rpcbind statd
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: DAEMON
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
2007-08-18 04:08:53 +00:00
|
|
|
name="lockd"
|
|
|
|
rcvar=rpc_lockd_enable
|
|
|
|
command="/usr/sbin/rpc.${name}"
|
|
|
|
start_precmd='lockd_precmd'
|
2008-06-27 15:45:17 +00:00
|
|
|
stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable'
|
2007-08-18 04:08:53 +00:00
|
|
|
status_precmd=$stop_precmd
|
2001-06-16 07:16:14 +00:00
|
|
|
|
2007-08-18 04:08:53 +00:00
|
|
|
# Make sure that we are either an NFS client or server, and that we get
|
|
|
|
# the correct flags from rc.conf(5).
|
2004-02-19 05:49:06 +00:00
|
|
|
#
|
2007-08-18 04:08:53 +00:00
|
|
|
lockd_precmd()
|
2007-03-30 19:08:58 +00:00
|
|
|
{
|
2007-05-17 08:57:14 +00:00
|
|
|
local ret
|
|
|
|
ret=0
|
|
|
|
|
2008-06-27 15:45:17 +00:00
|
|
|
if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable
|
2007-03-30 19:08:58 +00:00
|
|
|
then
|
2007-05-17 08:57:14 +00:00
|
|
|
ret=1
|
2007-03-30 19:08:58 +00:00
|
|
|
fi
|
|
|
|
if ! checkyesno rpcbind_enable && \
|
|
|
|
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
2007-05-17 08:57:14 +00:00
|
|
|
force_depend rpcbind || ret=1
|
2007-03-30 19:08:58 +00:00
|
|
|
fi
|
2007-08-17 07:58:26 +00:00
|
|
|
rc_flags=${rpc_lockd_flags}
|
2007-05-17 08:57:14 +00:00
|
|
|
return ${ret}
|
2007-03-30 19:08:58 +00:00
|
|
|
}
|
|
|
|
|
2001-06-16 07:16:14 +00:00
|
|
|
load_rc_config $name
|
2007-08-17 07:58:26 +00:00
|
|
|
run_rc_command $1
|