nlockmgr revision 064ed339d53d38ca3b43105dc6fc88512efed351
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington#!/sbin/sh
b129f72d951663755496670606e5f7303e8f2dc2Tinderbox User#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER START
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington#
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# The contents of this file are subject to the terms of the
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Common Development and Distribution License (the "License").
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# You may not use this file except in compliance with the License.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# or http://www.opensolaris.org/os/licensing.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# See the License for the specific language governing permissions
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# If applicable, add the following below this CDDL HEADER, with the
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# information: Portions Copyright [yyyy] [name of copyright owner]
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# CDDL HEADER END
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Use is subject to license terms.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley#ident "%Z%%M% %I% %E% SMI"
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley#
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley# Start the lockd service; we are serving NFS and we need to verify
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley# that rpcbind is accepting traffic from the network.
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley#
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob HalleyBIND_FMRI=svc:/network/rpc/bind
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halleydo_change=false
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halleyif set -- `svcprop -t -p config/local_only $BIND_FMRI`; then
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley if [ "$2" != boolean ]; then
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley echo "$0: config/local_only property for $BIND_FMRI has wrong "\
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley "type" 1>&2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein elif [ "$#" -ne 3 ]; then
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein echo "$0: config/local_only property for $BIND_FMRI has wrong "\
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein "number of values" 1>&2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein elif [ "$3" = true ]; then
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews do_change=true
cfa2326b5c96a3a4c720262e077b2baf9fc27970Tinderbox User fi
81f58902eb5a1c1ab22742c72bd6cf318acbc06aTinderbox Userelse
b129f72d951663755496670606e5f7303e8f2dc2Tinderbox User # If the property is not found, we just set it.
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews do_change=true
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinfi
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinif $do_change
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinthen
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein # These will generate errors in the log.
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews svccfg -s $BIND_FMRI setprop config/local_only = boolean: false
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein if [ $? != 0 ]; then
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein echo "$0: WARNING setprop failed" 1>&2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein fi
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt svcadm refresh $BIND_FMRI
4610465ed9408cbe434dbfb8be8ea53f48969c91Bob Halley if [ $? != 0 ]; then
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt echo "$0: WARNING svcadm refresh failed" 1>&2
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt fi
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntfi
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntexec /usr/lib/nfs/lockd
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt