8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / fs.d / nfs / svc / nlockmgr
blobc5d8b622a62199b265a876805bcebcc6dc5d8c58
1 #!/sbin/sh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
23 # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 # Copyright (c) 2015 by Delphix. All rights reserved.
25 # Use is subject to license terms.
29 # Start the lockd service; we are serving NFS and we need to verify
30 # that rpcbind is accepting traffic from the network.
33 BIND_FMRI=svc:/network/rpc/bind
34 do_change=false
35 if set -- `svcprop -t -p config/local_only $BIND_FMRI`; then
36 if [ "$2" != boolean ]; then
37 echo "$0: config/local_only property for $BIND_FMRI has wrong "\
38 "type" 1>&2
39 elif [ "$#" -ne 3 ]; then
40 echo "$0: config/local_only property for $BIND_FMRI has wrong "\
41 "number of values" 1>&2
42 elif [ "$3" = true ]; then
43 do_change=true
45 else
46 # If the property is not found, we just set it.
47 do_change=true
50 if $do_change
51 then
52 # These will generate errors in the log.
53 svccfg -s $BIND_FMRI setprop config/local_only = boolean: false
54 if [ $? != 0 ]; then
55 echo "$0: WARNING setprop failed" 1>&2
58 svcadm refresh $BIND_FMRI
59 if [ $? != 0 ]; then
60 echo "$0: WARNING svcadm refresh failed" 1>&2
65 # We have to wait for statd to finish starting up before lockd can
66 # start running. If statd hangs after service startup (so SMF thinks
67 # it's done) but before it registers an rpc address, we can end up
68 # failing in the kernel when we attempt to contact it.
70 until /usr/bin/rpcinfo -T tcp 127.0.0.1 status >/dev/null 2>&1
72 sleep 1
73 done
75 exec /usr/lib/nfs/lockd