Blame SOURCES/tomcat-7.0.wrapper

262920
#!/bin/bash
262920
262920
if [ -r /usr/share/java-utils/java-functions ]; then
262920
  . /usr/share/java-utils/java-functions
262920
else
262920
  echo "Can't read Java functions library, aborting"
262920
  exit 1
262920
fi
262920
262920
# Get the tomcat config (use this for environment specific settings)
262920
if [ -z "${TOMCAT_CFG}" ]; then
262920
  TOMCAT_CFG="/etc/tomcat/tomcat.conf"
262920
fi
262920
262920
if [ -r "$TOMCAT_CFG" ]; then
262920
  . $TOMCAT_CFG
262920
fi
262920
262920
# Get instance specific config file
262920
if [ -r "/etc/sysconfig/${NAME}" ]; then
262920
    . /etc/sysconfig/${NAME}
262920
fi
262920
262920
set_javacmd
262920
cd ${CATALINA_HOME}
262920
# CLASSPATH munging
262920
if [ ! -z "$CLASSPATH" ] ; then
262920
  CLASSPATH="$CLASSPATH":
262920
fi
262920
262920
if [ -n "$JSSE_HOME" ]; then
262920
  CLASSPATH="${CLASSPATH}$(build-classpath jcert jnet jsse 2>/dev/null):"
262920
fi
262920
CLASSPATH="${CLASSPATH}${CATALINA_HOME}/bin/bootstrap.jar"
262920
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/tomcat-juli.jar"
262920
CLASSPATH="${CLASSPATH}:$(build-classpath commons-daemon 2>/dev/null)"
262920
262920
if [ "$1" = "start" ]; then
262920
  ${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \
262920
    -classpath "$CLASSPATH" \
262920
    -Dcatalina.base="$CATALINA_BASE" \
262920
    -Dcatalina.home="$CATALINA_HOME" \
262920
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
262920
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
262920
    -Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \
262920
    -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \
262920
    org.apache.catalina.startup.Bootstrap start \
262920
    >> ${CATALINA_BASE}/logs/catalina.out 2>&1 &
262920
    if [ ! -z "$CATALINA_PID" ]; then
262920
      echo $! > $CATALINA_PID
262920
    fi
262920
elif [ "$1" = "start-security" ]; then
262920
  ${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \
262920
    -classpath "$CLASSPATH" \
262920
    -Dcatalina.base="$CATALINA_BASE" \
262920
    -Dcatalina.home="$CATALINA_HOME" \
262920
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
262920
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
262920
    -Djava.security.manager \
262920
    -Djava.security.policy=="${CATALINA_BASE}/conf/catalina.policy" \
262920
    -Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \
262920
    -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \
262920
    org.apache.catalina.startup.Bootstrap start \
262920
    >> ${CATALINA_BASE}/logs/catalina.out 2>&1 &
262920
    if [ ! -z "$CATALINA_PID" ]; then
262920
      echo $! > $CATALINA_PID
262920
    fi
262920
elif [ "$1" = "stop" ]; then
262920
  ${JAVACMD} $JAVA_OPTS \
262920
    -classpath "$CLASSPATH" \
262920
    -Dcatalina.base="$CATALINA_BASE" \
262920
    -Dcatalina.home="$CATALINA_HOME" \
262920
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
262920
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
262920
    org.apache.catalina.startup.Bootstrap stop \
262920
    >> ${CATALINA_BASE}/logs/catalina.out 2>&1
262920
elif [ "$1" = "version" ]; then
262920
  ${JAVACMD} -classpath ${CATALINA_HOME}/lib/catalina.jar \
262920
    org.apache.catalina.util.ServerInfo
262920
else
262920
  echo "Usage: $0 {start|start-security|stop|version}"
262920
  exit 1
262920
fi