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