#!/bin/sh # # $Header: opsm/utl/jwcctl.sbs /unix/10 2016/04/21 15:33:50 jgrout Exp $ # # # Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. # # NAME # jwcctl - Oracle JWC Control Utility # # DESCRIPTION # # # MODIFIED (MM/DD/YY) # jgrout 04/12/16 - Fix bug 22651447 # gmaldona 01/21/16 - Add CRS_ERROR: to the message errors of RMI_PORT and # HTTP_PORT # lluis 01/19/16 - Export TLS_ENABLED property of resource as # environment variable # gmaldona 12/02/15 - Fix bug-22292703, export PERL5LIB. # jgrout 11/10/15 - Use _CRS_CRS_CSS_NODENAME instead of olsnodes # jgrout 10/14/15 - Fix bug 22022480 # jgrout 08/12/15 - Remove explicit JDK8 references # rtamezd 05/28/15 - Make CATALINA_BASE generic # jgrout 05/20/15 - Move CATALINA_BASE to ORACLE_BASE # jgrout 02/27/15 - Adapt for JWC Control from OC4J Control # jgrout 05/15/14 - Fix bug 18372004 # jgrout 03/13/14 - Fix bug 17920033 # jgrout 03/06/13 - Forward merge fix for bug 15968944 to main # jgrout 01/31/12 - Trim down script for generic action scripts # jgrout 03/22/11 - 11857338: On AIX, add sleep after SIGQUIT # to allow extra time for dump procesing # sbasu 06/05/10 - 9770830:fix path for internal check action # yizhang 05/18/10 - fix bug 9709218 # sbasu 04/20/10 - #9441951:fix async shutdown of resource # yizhang 03/05/10 - fix bug 9440103 # sbasu 01/14/10 - Add log rotation to oc4j.out/oc4j.err, remove # passing of CPU Count as parameter # yizhang 08/06/09 - fix lrg 4107946 # dsemler 06/12/09 - set default number of cpus to 16 # sravindh 05/05/09 - Bug 8481528 # sbasu 05/03/09 - #8414731:start OC4J process in the background, # #8422785:provide clean action # yizhang 04/28/09 - fix bug 8452011 # sbasu 04/27/09 - #8459117:start oc4j with java.awt.headless to # prevent X Server authentication failures # sbasu 03/30/09 - add crsctl get jazn # dsemler 03/23/09 - update dbwlm logging property name, add rulesengine # cpucount property # dsemler 02/13/09 - make sure COMMAND is executed # dsemler 02/13/09 - Add support for USR_ORA_ENV to enable debugging # msubrahm 02/09/09 - option to specify http port in env # rxkumar 02/03/09 - fix bug8218759 # sbasu 01/07/09 - Merge shiphome version of script with this # sbasu 11/05/08 - Fix script # sbasu 11/05/08 - Fix script # spavan 04/10/08 - fix ORACLE_HOME getting logic # spavan 04/10/08 - fix ORACLE_HOME getting logic # spavan 12/04/07 - Set OC4J_PORT from PORT resource # spavan 12/04/07 - Set OC4J_PORT from PORT resource # lweng 10/15/07 - Creation # lweng 10/15/07 - Creation # # Preserve the command arg ACTION=$1 # Set environment variables OHOME=%ORACLE_HOME% OBASE=%ORACLE_BASE% ECHO="/bin/echo" # PERL Variables PERL_DIR=$OHOME/perl PERL_BIN=$PERL_DIR/bin PERL5LIB=$PERL_DIR/lib export PERL5LIB # TOMCAT Variables CATALINA_HOME=$OHOME/tomcat export CATALINA_HOME # Read the CRS_CSS_NODENAME attribute passed in variable _CRS_CRS_CSS_NODENAME # Read the APPLICATION attribute passed in variable _CRS_APPLICATION CATALINA_BASE=$OBASE/crsdata/$_CRS_CRS_CSS_NODENAME/$_CRS_APPLICATION export CATALINA_BASE # JAVA_HOME JAVA_HOME=$OHOME/jdk export JAVA_HOME # turn on output capture _CRS_UI_FMT=-v export _CRS_UI_FMT # RMI_PORT is the rmi port of JWC # # Read the PORT attribute passed in variable _CRS_PORT if [ "X$_CRS_PORT" != "X" ]; then RMI_PORT=$_CRS_PORT export RMI_PORT fi case $RMI_PORT in "") echo "CRS_ERROR:*** RMI_PORT Not Set!" echo "CRS_ERROR: Set and export RMI_PORT, then re-run" exit 1;; esac # HTTP_PORT is the http port of JWC # # Read the HTTP_PORT attribute passed in variable _CRS_HTTP_PORT if [ "X$_CRS_HTTP_PORT" != "X" ]; then HTTP_PORT=$_CRS_HTTP_PORT export HTTP_PORT fi case $HTTP_PORT in "") echo "CRS_ERROR:*** HTTP_PORT Not Set!" echo "CRS_ERROR: Set and export HTTP_PORT, then re-run" exit 1;; esac # TLS_ENABLED is the TLS protocol configuration of JWC # # Read the TLS_ENABLED attribute passed in variable _CRS_TLS_ENABLED if [ "X$_CRS_TLS_ENABLED" != "X" ]; then TLS_ENABLED=$_CRS_TLS_ENABLED export TLS_ENABLED fi # JRE Server options JRE_OPTIONS= JRE_OPTIONS_SERVER="-server" SIGQUIT_SLEEP_INTERVAL=0 ################################## #### Platform Specific Checks #### ################################## # Set the shared library path for JNI shared libraries # A few platforms use an environment variable other than LD_LIBRARY_PATH PLATFORM=`uname` export PLATFORM case $PLATFORM in AIX) LIBPATH=$OHOME/lib:$OHOME/srvm/lib:$LIBPATH export LIBPATH JRE_OPTIONS="-d64" JRE_OPTIONS_SERVER="-server $JRE_HEAP_OPTIONS" # Bug 11857338 - On AIX, add sleep after SIGQUIT # (because the JVM handles SIGQUIT asynchronously, # it needs extra time before we issue SIGKILL # to produce the requested dump) SIGQUIT_SLEEP_INTERVAL=5 ;; Linux) LD_LIBRARY_PATH=$OHOME/lib:$OHOME/srvm/lib:$LD_LIBRARY_PATH # Linux ( ppc64 || s390x ) => LD_LIBRARY_PATH lib32 ARCH=`uname -m`; if [ "$ARCH" = "ppc64" -o "$ARCH" = "s390x" ] then JRE_OPTIONS="-d64" JRE_OPTIONS_SERVER="-server $JRE_HEAP_OPTIONS" fi export LD_LIBRARY_PATH ;; SunOS) LD_LIBRARY_PATH_64=$OHOME/lib:$OHOME/srvm/lib:$LD_LIBRARY_PATH_64 export LD_LIBRARY_PATH_64 LD_LIBRARY_PATH=$OHOME/lib:$OHOME/srvm/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH JRE_OPTIONS="-d64" ;; *) # Do nothing ;; esac export JRE_OPTIONS export JRE_OPTIONS_SERVER # Main() case "$ACTION" in 'start') $PERL_BIN/perl -I$OHOME/lib $OHOME/bin/jwcctl.pl start STARTRC="$?" $ECHO "Return code is $STARTRC" exit $STARTRC ;; 'stop') # Stop JWC $PERL_BIN/perl -I$OHOME/lib $OHOME/bin/jwcctl.pl stop STOPRC="$?" $ECHO "Return code is $STOPRC" exit $STOPRC ;; 'check') $PERL_BIN/perl -I$OHOME/lib $OHOME/bin/jwcctl.pl check CHECKRC="$?" $ECHO "Return code is $CHECKRC" exit $CHECKRC ;; 'clean') # Kill JWC process $PERL_BIN/perl -I$OHOME/lib $OHOME/bin/jwcctl.pl clean $SIGQUIT_SLEEP_INTERVAL CLEANRC="$?" $ECHO "Return code is $CLEANRC" exit $CLEANRC ;; *) # Ignore action $ECHO "Ignoring unknown JWC action $ACTION" UNKNOWNRC=0 $ECHO "Return code is $UNKNOWNRC" exit $UNKNOWNRC esac