]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/statd
This commit was generated by cvs2svn to compensate for changes in r172767,
[FreeBSD/FreeBSD.git] / etc / rc.d / statd
1 #!/bin/sh
2 #
3 # $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 Exp
5 # $FreeBSD$
6 #
7
8 # PROVIDE: statd
9 # REQUIRE: nfsserver nfsclient nfsd rpcbind
10 # BEFORE:  DAEMON
11 # KEYWORD: nojail
12
13 . /etc/rc.subr
14
15 name="statd"
16 rcvar=rpc_statd_enable
17 command="/usr/sbin/rpc.${name}"
18 start_precmd='statd_precmd'
19 stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable'
20 status_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 #
25 statd_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_statd_flags}
40         return ${ret}
41 }
42
43 load_rc_config $name
44 run_rc_command $1