xref: /titanic_51/usr/src/cmd/zoneadm/svc-resource-mgmt (revision 0209230bf1261579beab4f55226bb509e6b850cb)
1*0209230bSgjelinek#!/sbin/sh
2*0209230bSgjelinek#
3*0209230bSgjelinek# CDDL HEADER START
4*0209230bSgjelinek#
5*0209230bSgjelinek# The contents of this file are subject to the terms of the
6*0209230bSgjelinek# Common Development and Distribution License (the "License").
7*0209230bSgjelinek# You may not use this file except in compliance with the License.
8*0209230bSgjelinek#
9*0209230bSgjelinek# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0209230bSgjelinek# or http://www.opensolaris.org/os/licensing.
11*0209230bSgjelinek# See the License for the specific language governing permissions
12*0209230bSgjelinek# and limitations under the License.
13*0209230bSgjelinek#
14*0209230bSgjelinek# When distributing Covered Code, include this CDDL HEADER in each
15*0209230bSgjelinek# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0209230bSgjelinek# If applicable, add the following below this CDDL HEADER, with the
17*0209230bSgjelinek# fields enclosed by brackets "[]" replaced with your own identifying
18*0209230bSgjelinek# information: Portions Copyright [yyyy] [name of copyright owner]
19*0209230bSgjelinek#
20*0209230bSgjelinek# CDDL HEADER END
21*0209230bSgjelinek#
22*0209230bSgjelinek#
23*0209230bSgjelinek# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*0209230bSgjelinek# Use is subject to license terms.
25*0209230bSgjelinek
26*0209230bSgjelinek# ident	"%Z%%M%	%I%	%E% SMI"
27*0209230bSgjelinek#
28*0209230bSgjelinek
29*0209230bSgjelinek. /lib/svc/share/smf_include.sh
30*0209230bSgjelinek
31*0209230bSgjelinek[ ! -f /etc/zones/global.xml ] && exit $SMF_EXIT_OK	# No global zone
32*0209230bSgjelinek							# resource mgmt.
33*0209230bSgjelinek							# configuration
34*0209230bSgjelinek
35*0209230bSgjelinek[ ! -x /usr/sbin/zoneadm ] && exit $SMF_EXIT_OK # SUNWzoneu not installed
36*0209230bSgjelinek
37*0209230bSgjelinek# Make sure working directory is / to prevent unmounting problems.
38*0209230bSgjelinekcd /
39*0209230bSgjelinekPATH=/usr/sbin:/usr/bin; export PATH
40*0209230bSgjelinek
41*0209230bSgjelinekcase "$1" in
42*0209230bSgjelinek'start')
43*0209230bSgjelinek	zoneadm -z global apply
44*0209230bSgjelinek	if [ $? -ne 0 ]; then
45*0209230bSgjelinek                exit $SMF_EXIT_ERR_FATAL
46*0209230bSgjelinek        fi
47*0209230bSgjelinek	;;
48*0209230bSgjelinek
49*0209230bSgjelinek*)
50*0209230bSgjelinek	echo "Usage: $0 start"
51*0209230bSgjelinek	exit $SMF_EXIT_ERR_FATAL
52*0209230bSgjelinek	;;
53*0209230bSgjelinekesac
54*0209230bSgjelinekexit $SMF_EXIT_OK
55