1281N/A#!/bin/sh
1186N/A#
1186N/A# CDDL HEADER START
58N/A#
58N/A# The contents of this file are subject to the terms of the
58N/A# Common Development and Distribution License (the "License").
1281N/A# You may not use this file except in compliance with the License.
58N/A#
58N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
58N/A# or http://www.opensolaris.org/os/licensing.
58N/A# See the License for the specific language governing permissions
58N/A# and limitations under the License.
58N/A#
58N/A# When distributing Covered Code, include this CDDL HEADER in each
58N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
58N/A# If applicable, add the following below this CDDL HEADER, with the
58N/A# fields enclosed by brackets "[]" replaced with your own identifying
58N/A# information: Portions Copyright [yyyy] [name of copyright owner]
58N/A#
58N/A# CDDL HEADER END
58N/A#
58N/A
58N/A#
1186N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
1186N/A# Use is subject to license terms.
1478N/A#
1186N/A
1186N/A. /lib/svc/share/smf_include.sh
1281N/A
962N/ASVCNAME='Logical Domains agents'
1470N/ALDMAD='/usr/lib/ldoms/ldmad'
1281N/AVLDS='/devices/virtual-devices@100/channel-devices@200/virtual-domain-service@0:vlds'
1281N/Amach=`/sbin/uname -m`
1281N/A
1281N/Aif [ "$mach" != "sun4v" ]; then
1281N/A echo "The $SVCNAME service is not supported on this platform."
1281N/A exit "$SMF_EXIT_ERR_FATAL"
1281N/Afi
1281N/A
1281N/Aif smf_is_nonglobalzone; then
1281N/A echo "The $SVCNAME service has been disabled because " \
1281N/A "it is not supported in a local zone."
850N/A /usr/sbin/svcadm disable "$SMF_FMRI"
896N/A sleep 5 &
1384N/A exit "$SMF_EXIT_OK"
1384N/Afi
1384N/A
1354N/A#
896N/A# The Logical Domains agents service is enabled by default on sun4v platforms.
1186N/A# However it can fail to start if the domain has a machine description in which
1281N/A# the vlds node is not defined (because it has an old MD or firmware). So we
1186N/A# check if a vlds device is effectively defined. If not then we disable the
1419N/A# service for this session. We don't return an error so that the service does
1186N/A# not go into the maintenance state and generate spurious error (especially if
1186N/A# the system is not configured with LDoms). The service is not permanently
1186N/A# disabled so that the service can come up if the domain is restarted with a
1281N/A# compatible MD.
1352N/A#
1335N/Aif [ ! -c "$VLDS" ]; then
1281N/A echo "The $SVCNAME service has been disabled because the system" \
1281N/A "has no virtual domain service (vlds) device."
1281N/A /usr/sbin/svcadm disable -t "$SMF_FMRI"
1352N/A sleep 5 &
1354N/A exit "$SMF_EXIT_OK"
1281N/Afi
1281N/A
1281N/Aif [ ! -x "$LDMAD" ]; then
1352N/A echo "The $SVCNAME service requires the $LDMAD executable."
1354N/A exit "$SMF_EXIT_ERR_CONFIG"
1281N/Afi
1281N/A
1281N/A$LDMAD
1352N/A
1354N/AEXIT=$?
1281N/A
1281N/Aif [ "$EXIT" != 0 ]; then
1281N/A exit "$EXIT"
1352N/Afi
1354N/A
1281N/Aexit "$SMF_EXIT_OK"
1281N/A