Created
March 28, 2017 03:15
-
-
Save masbog/e823e3a79a4fba47eaea7d61bd86db38 to your computer and use it in GitHub Desktop.
Supervisord Tomcat 8 on Debian (compressed binary extract to /opt/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function shutdown() | |
{ | |
date | |
echo "Shutting down Tomcat" | |
unset CATALINA_PID # Necessary in some cases | |
unset JAVA_OPTS # Necessary in some cases | |
$CATALINA_HOME/bin/catalina.sh stop | |
} | |
date | |
echo "Starting Tomcat" | |
export CATALINA_BASE=/opt/tomcat-8 | |
export CATALINA_HOME=/opt/tomcat-8 | |
export CATALINA_TMPDIR=/opt/tomcat-8/temp | |
export JRE_HOME=/usr | |
export CLASSPATH=/opt/tomcat-8/bin/bootstrap.jar:/opt/tomcat-8/bin/tomcat-juli.jar | |
export CATALINA_PID=/tmp/$$ | |
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") | |
export JAVA_OPTS="-Xms256m -Xmx3072m -XX:MaxPermSize=512m" | |
# Uncomment to increase Tomcat's maximum heap allocation | |
# export JAVA_OPTS=-Xmx512M $JAVA_OPTS | |
. $CATALINA_HOME/bin/catalina.sh start | |
# Allow any signal which would kill a process to stop Tomcat | |
trap shutdown HUP INT QUIT ABRT KILL ALRM TERM TSTP | |
echo "Waiting for `cat $CATALINA_PID`" | |
wait `cat $CATALINA_PID` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:tomcat-8] | |
command=/opt/tomcat-8/supervisord-tomcat-8-wrapper.sh | |
stdout_logfile=syslog | |
stderr_logfile=syslog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment