Skip to content

Instantly share code, notes, and snippets.

@mariorez
Last active March 18, 2020 16:26
Show Gist options
  • Save mariorez/d70ee9e8301eec783d0e to your computer and use it in GitHub Desktop.
Save mariorez/d70ee9e8301eec783d0e to your computer and use it in GitHub Desktop.
[program:tomcat6]
command=/opt/tomcat6-instance/bin/supervisor-wrapper.sh
#!/bin/bash
# Source: http://serverfault.com/questions/425132/controlling-tomcat-with-supervisor
function shutdown()
{
date
echo "Shutting down Tomcat"
unset CATALINA_PID # Necessary in some cases
$CATALINA_HOME/bin/catalina.sh stop
}
date
echo "Starting Tomcat"
export JAVA_HOME="/usr/lib/jvm/java-7-oracle"
export CATALINA_HOME="/usr/share/tomcat6"
export CATALINA_BASE="/opt/tomcat6-instance"
export CATALINA_PID=/tmp/$$
. $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`
[inet_http_server]
port = 127.0.0.1:9001
username = user
password = 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment