xref: /titanic_41/usr/src/cmd/xvm/ipagent/svc-ipagent (revision 99ba4d70906e5f67853c25ade6ebf4da3e5be4d6)
1*99ba4d70SRussell Blaine#!/bin/ksh
2*99ba4d70SRussell Blaine#
3*99ba4d70SRussell Blaine# CDDL HEADER START
4*99ba4d70SRussell Blaine#
5*99ba4d70SRussell Blaine# The contents of this file are subject to the terms of the
6*99ba4d70SRussell Blaine# Common Development and Distribution License (the "License").
7*99ba4d70SRussell Blaine# You may not use this file except in compliance with the License.
8*99ba4d70SRussell Blaine#
9*99ba4d70SRussell Blaine# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*99ba4d70SRussell Blaine# or http://www.opensolaris.org/os/licensing.
11*99ba4d70SRussell Blaine# See the License for the specific language governing permissions
12*99ba4d70SRussell Blaine# and limitations under the License.
13*99ba4d70SRussell Blaine#
14*99ba4d70SRussell Blaine# When distributing Covered Code, include this CDDL HEADER in each
15*99ba4d70SRussell Blaine# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*99ba4d70SRussell Blaine# If applicable, add the following below this CDDL HEADER, with the
17*99ba4d70SRussell Blaine# fields enclosed by brackets "[]" replaced with your own identifying
18*99ba4d70SRussell Blaine# information: Portions Copyright [yyyy] [name of copyright owner]
19*99ba4d70SRussell Blaine#
20*99ba4d70SRussell Blaine# CDDL HEADER END
21*99ba4d70SRussell Blaine#
22*99ba4d70SRussell Blaine# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*99ba4d70SRussell Blaine# Use is subject to license terms.
24*99ba4d70SRussell Blaine
25*99ba4d70SRussell Blaineinterval=$2
26*99ba4d70SRussell Blaine
27*99ba4d70SRussell Blaine. /lib/svc/share/xvm_include.sh
28*99ba4d70SRussell Blaine
29*99ba4d70SRussell Blainecase $1 in
30*99ba4d70SRussell Blaine'start')
31*99ba4d70SRussell Blaine	#
32*99ba4d70SRussell Blaine	# This service should only be enabled in a PV domU.
33*99ba4d70SRussell Blaine	#
34*99ba4d70SRussell Blaine	if is_dom0 || [ `uname -i` != "i86xpv" ]; then
35*99ba4d70SRussell Blaine		echo "This service will only run in a PV xVM domU."
36*99ba4d70SRussell Blaine		svcadm disable -t svc:/system/xvm/ipagent:default
37*99ba4d70SRussell Blaine		exit $SMF_EXIT_OK
38*99ba4d70SRussell Blaine	fi
39*99ba4d70SRussell Blaine
40*99ba4d70SRussell Blaine	/usr/lib/xen/bin/ipagent $interval &
41*99ba4d70SRussell Blaine
42*99ba4d70SRussell Blaine	;;
43*99ba4d70SRussell Blaine
44*99ba4d70SRussell Blaine*)
45*99ba4d70SRussell Blaine	echo "Usage: $0 start [report_interval]"
46*99ba4d70SRussell Blaine	exit 1
47*99ba4d70SRussell Blaine	;;
48*99ba4d70SRussell Blaineesac
49*99ba4d70SRussell Blaine
50*99ba4d70SRussell Blaineexit $?
51