]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/statd
This commit was generated by cvs2svn to compensate for changes in r170256,
[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$
5 #
6
7 # PROVIDE: nfslocking
8 # REQUIRE: nfsserver nfsclient nfsd rpcbind
9 # BEFORE:  DAEMON
10 # KEYWORD: nojail
11
12 . /etc/rc.subr
13
14 # Save the (one) commandline argument in case it gets clobbered.
15 arg=$1
16
17 # Either NFS client or server must be enabled and rpcbind(8) must be started.
18 #
19 nfslocking_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
34         if [ $name = "statd" ] 
35         then
36                 rc_flags=${rpc_statd_flags}
37         elif [ $name = "lockd" ]
38         then
39                 rc_flags=${rpc_lockd_flags}
40         fi
41
42         return ${ret}
43 }
44
45 start_precmd="nfslocking_precmd"
46 stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable'
47 status_precmd=$stop_precmd
48
49 # rpc.statd
50 #
51 name="statd"
52 rcvar=rpc_statd_enable
53 command="/usr/sbin/rpc.${name}"
54 load_rc_config $name
55 run_rc_command "$arg"
56
57 # rpc.lockd
58 #
59 name="lockd"
60 rcvar=rpc_lockd_enable
61 command="/usr/sbin/rpc.${name}"
62 load_rc_config $name
63 run_rc_command "$arg"