xref: /dragonfly/etc/rc.d/lockd (revision 19fe1c42)
1#!/bin/sh
2#
3# FreeBSD History: src/etc/rc.d/nfslocking,v 1.11 2004/10/07 13:55:26 mtm
4# $FreeBSD: src/etc/rc.d/lockd,v 1.22 2008/07/16 19:50:29 dougb Exp $
5# $DragonFly$
6#
7
8# PROVIDE: lockd
9# REQUIRE: nfsserver nfsclient nfsd rpcbind statd
10# BEFORE:  DAEMON
11# KEYWORD: nojail shutdown
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