nlockmgr revision 7b4e6d92ac8978742d2afae42fe91917af8b8938
71cef386fae61275b03e203825680b39fedaa8c6Tinderbox User# CDDL HEADER START
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# The contents of this file are subject to the terms of the
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# Common Development and Distribution License (the "License").
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# You may not use this file except in compliance with the License.
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# See the License for the specific language governing permissions
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# and limitations under the License.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# When distributing Covered Code, include this CDDL HEADER in each
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# If applicable, add the following below this CDDL HEADER, with the
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# information: Portions Copyright [yyyy] [name of copyright owner]
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# CDDL HEADER END
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# Copyright (c) 2015 by Delphix. All rights reserved.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# Use is subject to license terms.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# Start the lockd service; we are serving NFS and we need to verify
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# that rpcbind is accepting traffic from the network.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userif set -- `svcprop -t -p config/local_only $BIND_FMRI`; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if [ "$2" != boolean ]; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User echo "$0: config/local_only property for $BIND_FMRI has wrong "\
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User echo "$0: config/local_only property for $BIND_FMRI has wrong "\
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User elif [ "$3" = true ]; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User # If the property is not found, we just set it.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User # These will generate errors in the log.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User svccfg -s $BIND_FMRI setprop config/local_only = boolean: false
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if [ $? != 0 ]; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if [ $? != 0 ]; then
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User echo "$0: WARNING svcadm refresh failed" 1>&2
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# We have to wait for statd to finish starting up before lockd can
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# start running. If statd hangs after service startup (so SMF thinks
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# it's done) but before it registers an rpc address, we can end up
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# failing in the kernel when we attempt to contact it.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox Useruntil /usr/bin/rpcinfo -T tcp 127.0.0.1 status >/dev/null 2>&1