xref: /titanic_41/usr/src/cmd/fs.d/nfs/svc/nlockmgr (revision 064ed339d53d38ca3b43105dc6fc88512efed351)
1*064ed339Sjjj#!/sbin/sh
2*064ed339Sjjj#
3*064ed339Sjjj# CDDL HEADER START
4*064ed339Sjjj#
5*064ed339Sjjj# The contents of this file are subject to the terms of the
6*064ed339Sjjj# Common Development and Distribution License (the "License").
7*064ed339Sjjj# You may not use this file except in compliance with the License.
8*064ed339Sjjj#
9*064ed339Sjjj# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*064ed339Sjjj# or http://www.opensolaris.org/os/licensing.
11*064ed339Sjjj# See the License for the specific language governing permissions
12*064ed339Sjjj# and limitations under the License.
13*064ed339Sjjj#
14*064ed339Sjjj# When distributing Covered Code, include this CDDL HEADER in each
15*064ed339Sjjj# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*064ed339Sjjj# If applicable, add the following below this CDDL HEADER, with the
17*064ed339Sjjj# fields enclosed by brackets "[]" replaced with your own identifying
18*064ed339Sjjj# information: Portions Copyright [yyyy] [name of copyright owner]
19*064ed339Sjjj#
20*064ed339Sjjj# CDDL HEADER END
21*064ed339Sjjj#
22*064ed339Sjjj#
23*064ed339Sjjj# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*064ed339Sjjj# Use is subject to license terms.
25*064ed339Sjjj#
26*064ed339Sjjj#ident	"%Z%%M%	%I%	%E% SMI"
27*064ed339Sjjj
28*064ed339Sjjj#
29*064ed339Sjjj# Start the lockd service; we are serving NFS and we need to verify
30*064ed339Sjjj# that rpcbind is accepting traffic from the network.
31*064ed339Sjjj#
32*064ed339Sjjj
33*064ed339SjjjBIND_FMRI=svc:/network/rpc/bind
34*064ed339Sjjjdo_change=false
35*064ed339Sjjjif set -- `svcprop -t -p config/local_only $BIND_FMRI`; then
36*064ed339Sjjj	if [ "$2" != boolean ]; then
37*064ed339Sjjj		echo "$0: config/local_only property for $BIND_FMRI has wrong "\
38*064ed339Sjjj		    "type" 1>&2
39*064ed339Sjjj	elif [ "$#" -ne 3 ]; then
40*064ed339Sjjj		echo "$0: config/local_only property for $BIND_FMRI has wrong "\
41*064ed339Sjjj		    "number of values" 1>&2
42*064ed339Sjjj	elif [ "$3" = true ]; then
43*064ed339Sjjj		do_change=true
44*064ed339Sjjj	fi
45*064ed339Sjjjelse
46*064ed339Sjjj	# If the property is not found, we just set it.
47*064ed339Sjjj	do_change=true
48*064ed339Sjjjfi
49*064ed339Sjjj
50*064ed339Sjjjif $do_change
51*064ed339Sjjjthen
52*064ed339Sjjj	# These will generate errors in the log.
53*064ed339Sjjj	svccfg -s $BIND_FMRI setprop config/local_only = boolean: false
54*064ed339Sjjj	if [ $? != 0 ]; then
55*064ed339Sjjj		echo "$0: WARNING setprop failed" 1>&2
56*064ed339Sjjj	fi
57*064ed339Sjjj
58*064ed339Sjjj	svcadm refresh $BIND_FMRI
59*064ed339Sjjj	if [ $? != 0 ]; then
60*064ed339Sjjj		echo "$0: WARNING svcadm refresh failed" 1>&2
61*064ed339Sjjj	fi
62*064ed339Sjjjfi
63*064ed339Sjjj
64*064ed339Sjjjexec /usr/lib/nfs/lockd
65