142N/A#!/sbin/sh
142N/A#
142N/A# CDDL HEADER START
142N/A#
142N/A# The contents of this file are subject to the terms of the
142N/A# Common Development and Distribution License (the "License").
142N/A# You may not use this file except in compliance with the License.
142N/A#
142N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
142N/A# or http://www.opensolaris.org/os/licensing.
142N/A# See the License for the specific language governing permissions
142N/A# and limitations under the License.
142N/A#
142N/A# When distributing Covered Code, include this CDDL HEADER in each
142N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
142N/A# If applicable, add the following below this CDDL HEADER, with the
142N/A# fields enclosed by brackets "[]" replaced with your own identifying
142N/A# information: Portions Copyright [yyyy] [name of copyright owner]
142N/A#
142N/A# CDDL HEADER END
142N/A#
142N/A
142N/A#
3959N/A# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
142N/A#
142N/A
142N/A. /lib/svc/share/smf_include.sh
142N/A
4246N/ACATALINA_HOME=/usr/tomcat8
1832N/A# We allow CATALINA_BASE setting from environment so that we can support
1832N/A# multiple Tomcat instances.
4246N/ACATALINA_BASE=${CATALINA_BASE:-/var/tomcat8}
3959N/AJAVA_HOME=/usr/jdk/instances/jdk1.8.0
4246N/Aexport CATALINA_HOME CATALINA_BASE JAVA_HOME
142N/A
142N/Acase "$1" in
142N/Astart)
142N/A cmd="start";
142N/A ;;
142N/A
142N/Astop)
142N/A cmd="stop";
142N/A ;;
142N/A*)
142N/A echo "Usage: $0 {start|stop}"
142N/A exit $SMF_EXIT_ERR_CONFIG
142N/A ;;
142N/Aesac
142N/A
142N/A$CATALINA_HOME/bin/catalina.sh $cmd 2>&1
142N/A
142N/Aif [ $? -ne 0 ]; then
142N/A echo "Tomcat failed to start. Check the log (defaults to $CATALINA_BASE/logs/catalina.out) for more information, if any."
142N/A exit $SMF_EXIT_ERR_FATAL
142N/Afi
142N/A
142N/Aexit $SMF_EXIT_OK