2008-04-07 22:37:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -r /usr/share/java-utils/java-functions ]; then
|
|
|
|
. /usr/share/java-utils/java-functions
|
|
|
|
else
|
|
|
|
echo "Can't read Java functions library, aborting"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Get the tomcat config (use this for environment specific settings)
|
2010-09-29 20:31:33 +00:00
|
|
|
#if [ -z "${TOMCAT_CFG}" ]; then
|
|
|
|
# TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
|
|
|
|
#fi
|
2008-04-07 22:37:26 +00:00
|
|
|
|
2010-09-29 20:31:33 +00:00
|
|
|
#if [ -r "$TOMCAT_CFG" ]; then
|
|
|
|
# . $TOMCAT_CFG
|
|
|
|
#fi
|
2008-04-07 22:37:26 +00:00
|
|
|
|
|
|
|
set_javacmd
|
|
|
|
|
|
|
|
# CLASSPATH munging
|
|
|
|
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 [ "$1" = "start" ]; then
|
|
|
|
${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \
|
|
|
|
-classpath "$CLASSPATH" \
|
|
|
|
-Dcatalina.base="$CATALINA_BASE" \
|
|
|
|
-Dcatalina.home="$CATALINA_HOME" \
|
|
|
|
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
|
|
|
|
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
|
|
|
-Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \
|
|
|
|
-Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \
|
|
|
|
org.apache.catalina.startup.Bootstrap start \
|
|
|
|
>> ${CATALINA_BASE}/logs/catalina.out 2>&1 &
|
|
|
|
if [ ! -z "$CATALINA_PID" ]; then
|
|
|
|
echo $! > $CATALINA_PID
|
|
|
|
fi
|
|
|
|
elif [ "$1" = "start-security" ]; then
|
|
|
|
${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \
|
|
|
|
-classpath "$CLASSPATH" \
|
|
|
|
-Dcatalina.base="$CATALINA_BASE" \
|
|
|
|
-Dcatalina.home="$CATALINA_HOME" \
|
|
|
|
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
|
|
|
|
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
|
|
|
-Djava.security.manager \
|
2008-09-05 17:14:04 +00:00
|
|
|
-Djava.security.policy=="${CATALINA_BASE}/conf/catalina.policy" \
|
2008-04-07 22:37:26 +00:00
|
|
|
-Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \
|
|
|
|
-Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \
|
|
|
|
org.apache.catalina.startup.Bootstrap start \
|
|
|
|
>> ${CATALINA_BASE}/logs/catalina.out 2>&1 &
|
|
|
|
if [ ! -z "$CATALINA_PID" ]; then
|
|
|
|
echo $! > $CATALINA_PID
|
|
|
|
fi
|
|
|
|
elif [ "$1" = "stop" ]; then
|
2008-09-05 17:14:04 +00:00
|
|
|
${JAVACMD} $JAVA_OPTS \
|
2008-04-07 22:37:26 +00:00
|
|
|
-classpath "$CLASSPATH" \
|
|
|
|
-Dcatalina.base="$CATALINA_BASE" \
|
|
|
|
-Dcatalina.home="$CATALINA_HOME" \
|
|
|
|
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
|
|
|
|
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
|
|
|
org.apache.catalina.startup.Bootstrap stop \
|
|
|
|
>> ${CATALINA_BASE}/logs/catalina.out 2>&1
|
|
|
|
elif [ "$1" = "version" ]; then
|
|
|
|
${JAVACMD} -classpath ${CATALINA_HOME}/lib/catalina.jar \
|
|
|
|
org.apache.catalina.util.ServerInfo
|
|
|
|
else
|
|
|
|
echo "Usage: $0 {start|start-security|stop|version}"
|
|
|
|
exit 1
|
|
|
|
fi
|