Hello Jordan,
the attached are the batch file, which will start and stop IBM Liberty
servers and deploy the war files on this. Once it got started, a process
will be running in windows for liberty server.
server.startup.bat
_____________________
#!/bin/sh
# Licensed Materials - Property of IBM (c) Copyright IBM Corporation 2008,
2017.
# All Rights Reserved.
#
# Note to U.S. Government Users Restricted Rights: Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
if [ `uname` = SunOS ];
then
SPACE_PATTERN=' ' ;
else
SPACE_PATTERN='[[:space:]]' ;
fi
# Having a space in the directory name causes problems for how Tomcat
handles
# the JAVA_OPTS environment variable.
pwd | grep "$SPACE_PATTERN"
if [ $? -eq 0 ];
then /bin/echo \
ERROR: The Jazz Team Server may not be installed in a directory whose name
contains a space character. Please relocate the jazz directory and try
again.
exit 1
fi
PWD=`pwd`
if [ "$PWD" = "/" ] ; then
PWD=""
fi
START_DIR=`dirname "$0"`
cd "$START_DIR"
CLEAN=false
ACTION=start
LIBERTY=false
export LIBERTY
# Run in Liberty if it is installed, unless overridden by a command option
if [ -f "$PWD/liberty.server" ]; then
LIBERTY=true;
fi
for var in "$@"
do
if [ "$var" = "-debug" ] ; then
ACTION=debug
fi
if [ "$var" = "-clean" ] ; then
CLEAN=true
fi
if [ "$var" = "-create" ] ; then
ACTION=create
fi
if [ "$var" = "-run" ] ; then
ACTION=run
fi
if [ "$var" = "-tomcat" ] ; then
LIBERTY=false
fi
done
echo $TMP | grep "$SPACE_PATTERN"
if [ $? -eq 0 ];
then TEMP_DIR=/tmp ;
else TEMP_DIR=${TMP:-/tmp} ;
fi
# Unset JAVA_HOME because we really want to use the JRE that is bundled
unset JAVA_HOME
# When running in a Jazz build, JRE_HOME is already set
if [ -z "$_RUNNING_IN_JAZZ_BUILD" ]; then
# For Mac OS X (unsupported, but used by developers)
if [ `uname` = Darwin ];
then
JRE_HOME=$(/usr/libexec/java_home -v 1.7)
else
JRE_HOME="$PWD/jre";
fi;
fi
export JRE_HOME
# Using TLS only protocols protects against CVE-2014-3566 vulnerability
if [ `uname` = Darwin ];
then
JAVA_OPTS="$JAVA_OPTS
-Djazz.connector.sslEnabledProtocols=\"SSLv2Hello,TLSv1,TLSv1.1,TLSv1.2\""
JAVA_OPTS="$JAVA_OPTS -Djazz.connector.algorithm=SunX509"
else
JAVA_OPTS="$JAVA_OPTS
-Djazz.connector.sslEnabledProtocols=\"TLSv1,TLSv1.1,TLSv1.2\""
JAVA_OPTS="$JAVA_OPTS -Djazz.connector.algorithm=IbmX509"
fi
if [ -z "$CATALINA_HOME" ]; then
CATALINA_HOME="$PWD/tomcat"
export CATALINA_HOME;
fi
# Database properties may be provided by the db_system_properties
environment variable
if [ -n "${db_system_properties}" ]; then
JAVA_OPTS="$JAVA_OPTS ${db_system_properties}";
else
# The following four environment variables are used to point to the
appropriate
# JDBC jar file supplied by the database vendor. For Oracle and SQL
Server, the
# environment variable should point to the driver file itself; for db2i and
# db2z, the variable should point to the directory that contains the
multiple
# necessary jdbc driver files required on those platforms (for example,
# /opt/ibm/db2/V9.7/java). For DB2, the use of DB2_ABSPATH var is optional;
if not
# set the default driver packaged with the server will be used.
# Users should set these variables; if they are set, the script will respect
# their value. If they are unset, we try locating the driver files in a
# directory under <JazzInstallDir>/server. (For example, the default
location
# for the Oracle JDBC driver is under
<JazzInstallDir>/server/oracle/ojdbc8.jar).
if [ -z "$ORACLE_JDBC_DRIVER_FILE" ] ; then
ORACLE_JDBC_DRIVER_FILE="`cd \"$START_DIR\" 2>/dev/null && pwd ||
echo \"$START_DIR\"`/oracle/ojdbc8.jar" ;
fi
if [ -z "$SQLSERVER_JDBC_DRIVER_FILE" ] ; then
SQLSERVER_JDBC_DRIVER_FILE="`cd \"$START_DIR\" 2>/dev/null && pwd ||
echo \"$START_DIR\"`/sqlserver/sqljdbc41.jar" ;
fi
if [ -z "$DB2I_ABSPATH" ] ; then
DB2I_ABSPATH="`cd \"$START_DIR\" 2>/dev/null && pwd || echo
\"$START_DIR\"`/db2i" ;
fi
if [ -z "$DB2Z_ABSPATH" ] ; then
DB2Z_ABSPATH="`cd \"$START_DIR\" 2>/dev/null && pwd || echo
\"$START_DIR\"`/db2z" ;
fi
JAVA_OPTS="$JAVA_OPTS
-DSQLSERVER_JDBC_DRIVER_FILE=$SQLSERVER_JDBC_DRIVER_FILE"
JAVA_OPTS="$JAVA_OPTS
-DORACLE_JDBC_DRIVER_FILE=$ORACLE_JDBC_DRIVER_FILE"
JAVA_OPTS="$JAVA_OPTS -DDB2I_JDBC=$DB2I_ABSPATH"
JAVA_OPTS="$JAVA_OPTS -DDB2Z_JDBC=$DB2Z_ABSPATH"
if [ -n "$DB2_ABSPATH" ] ; then
JAVA_OPTS="$JAVA_OPTS -DDB2_ABSPATH=$DB2_ABSPATH/"
fi;
fi
COGNOS_SDK=$START_DIR/CognosSDK
export COGNOS_SDK
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS
-Dorg.eclipse.emf.ecore.plugin.EcorePlugin.doNotLoadResourcesPlugin=true"
JAVA_OPTS="$JAVA_OPTS
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
JAVA_OPTS="$JAVA_OPTS
-Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true"
JAVA_OPTS="$JAVA_OPTS -DJAZZ_HOME=file://$PWD/conf"
JAVA_OPTS="$JAVA_OPTS -Dcom.ibm.team.repository.tempDir=$TEMP_DIR"
JAVA_OPTS="$JAVA_OPTS
-Dlog4j.configuration=file://$PWD/conf/startup_log4j.properties"
# When run in a Jazz build, a 32-bit JRE is used, so don't set 64-bit
options
if [ -z "$_RUNNING_IN_JAZZ_BUILD" ]; then
JAVA_OPTS="$JAVA_OPTS -Xmx4G"
JAVA_OPTS="$JAVA_OPTS -Xms4G"
JAVA_OPTS="$JAVA_OPTS -Xmn1G"
JAVA_OPTS="$JAVA_OPTS -XX:MaxDirectMemorySize=1G";
fi
JAVA_OPTS="$JAVA_OPTS -Dderby.locks.waitTimeout=1200"
JAVA_OPTS="$JAVA_OPTS -Dderby.locks.deadlockTimeout=1140"
if [ "$CLEAN" = "true" ] ; then
JAVA_OPTS="$JAVA_OPTS -Djazz.clean=true"
fi
if [ "$ACTION" = "debug" ] ; then
JAVA_OPTS="$JAVA_OPTS -Dcom.ibm.team.repository.debug.enabled=true"
JAVA_OPTS="$JAVA_OPTS -Dcom.ibm.team.repository.debug.users=*"
fi
## *** Debug service properties ***
## Give access to restricted areas to all JazzAdmins users.
#JAVA_OPTS="$JAVA_OPTS -Dcom.ibm.team.repository.debug.users=JazzAdmins"
## Expose /repodebug/access service.
#JAVA_OPTS="$JAVA_OPTS
-Dcom.ibm.team.repository.debug.accessServiceEnabled=true"
## Patch service options.
#JAVA_OPTS="$JAVA_OPTS -Dcom.ibm.team.osgi.patch.disable=true"
#JAVA_OPTS="$JAVA_OPTS -Dcom.ibm.team.osgi.patch.directory=patch"
## Required for CLM Monitoring
# JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote=true"
# JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=1099"
# JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
# JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
## BEGIN app-specific options section
## END app-specific options section
# Enable verbose GC logging for serviceability
JAVA_OPTS="$JAVA_OPTS -verbose:gc"
if [ `uname` = SunOS ];
then
JAVA_OPTS="$JAVA_OPTS -d64" ;
JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=768m
-XX:ReservedCodeCacheSize=512M -XX:CodeCacheMinimumFreeSpace=2M
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass" ;
JAVA_OPTS="$JAVA_OPTS
-Djava.protocol.handler.pkgs=com.ibm.net.ssl.www2.protocol" ;
elif [ `uname` = Darwin ];
then
JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=1024m"
# JAVA_OPTS="$JAVA_OPTS -XX:ReservedCodeCacheSize=512M
-XX:CodeCacheMinimumFreeSpace=2M -XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass"
elif [ `uname` = AIX ];
then
JAVA_OPTS="$JAVA_OPTS -Xgcpolicy:gencon"
JAVA_OPTS="$JAVA_OPTS -Xnocompressedrefs"
# Enable GC log management only for IBM JVM
JAVA_OPTS="$JAVA_OPTS -Xverbosegclog:verbosegc.%y%m%d.%pid.txt,5,100000"
else
JAVA_OPTS="$JAVA_OPTS -Xgcpolicy:gencon"
# When run in a Jazz build, a 32-bit JRE is used, so don't set 64-bit
options
if [ -z "$_RUNNING_IN_JAZZ_BUILD" ]; then
JAVA_OPTS="$JAVA_OPTS -Xcompressedrefs
-Xgc:preferredHeapBase=0x100000000";
fi
# Enable GC log management only for IBM JVM
JAVA_OPTS="$JAVA_OPTS -Xverbosegclog:verbosegc.%y%m%d.%pid.txt,5,100000"
fi
export JAVA_OPTS
if [ "$LIBERTY" = "true" ]; then
./liberty.server $ACTION;
else
if [ ! -d "$CATALINA_HOME"/bin ]; then
/bin/echo "ERROR: There is no Liberty or Tomcat application server
to start."
exit 1
fi
# healthcenter not supported on Mac
if [ `uname` != Darwin ]; then
# health center currently disabled by default; see work item 413691
# JAVA_OPTS="$JAVA_OPTS -agentlib:healthcenter
-Dcom.ibm.java.diagnostics.healthcenter.agent.port=1972
-Dsun.rmi.registry.registryFilter=javax.rmi.CORBA.Stub"
JAVA_OPTS="$JAVA_OPTS"
fi
if [ "$ACTION" = "debug" ]; then
$CATALINA_HOME/bin/catalina.sh jpda start;
else
$CATALINA_HOME/bin/startup.sh;
fi;
fi
On Thursday, September 27, 2018 at 3:33:22 PM UTC+5:30, Jordan Borean wrote:
>
> You never really said what the batch file actually does. Does it start a
> process that runs in the background or is it meant to run a short living
> process?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/44fc841a-8d3c-49d4-97f6-04ae0c3fc786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.