tomcat/tomcat-preamble

62 lines
1.5 KiB
Bash

#!/bin/bash
. /usr/lib/tomcat/functions
# Get the tomcat config (use this for environment specific settings)
if [ -z "${TOMCAT_CFG_LOADED}" ]; then
if [ -z "${TOMCAT_CFG}" ]; then
TOMCAT_CFG="/etc/tomcat/tomcat.conf"
fi
. $TOMCAT_CFG
fi
if [ -d "${TOMCAT_CONFD=/etc/tomcat/conf.d}" ]; then
for file in ${TOMCAT_CONFD}/*.conf ; do
if [ -f "$file" ] ; then
. "$file"
fi
done
fi
if [ -z "$CATALINA_BASE" ]; then
if [ -n "$NAME" ]; then
if [ -z "$TOMCATS_BASE" ]; then
TOMCATS_BASE="/var/lib/tomcats/"
fi
CATALINA_BASE="${TOMCATS_BASE}${NAME}"
else
CATALINA_BASE="${CATALINA_HOME}"
fi
fi
# Include the optional setenv.sh script.
# (See section 3.4 of https://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt)
if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
. "$CATALINA_BASE/bin/setenv.sh"
elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
. "$CATALINA_HOME/bin/setenv.sh"
fi
VERBOSE=1
set_javacmd
cd ${CATALINA_HOME}
# CLASSPATH munging
if [ ! -z "$CLASSPATH" ] ; then
CLASSPATH="$CLASSPATH":
fi
if [ -n "$JSSE_HOME" ]; then
CLASSPATH="${CLASSPATH}$(build-classpath jcert jnet jsse 2>/dev/null):"
fi
CLASSPATH="${CLASSPATH}${CATALINA_HOME}/bin/bootstrap.jar"
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/tomcat-juli.jar"
CLASSPATH="${CLASSPATH}:$(build-classpath commons-daemon 2>/dev/null)"
if [ -z "$LOGGING_PROPERTIES" ] ; then
LOGGING_PROPERTIES="${CATALINA_BASE}/conf/logging.properties"
if [ ! -f "${LOGGING_PROPERTIES}" ] ; then
LOGGING_PROPERTIES="${CATALINA_HOME}/conf/logging.properties"
fi
fi