Difference between revisions of "Tomcat Startup Script"
From GFIPM Implementation Wiki
Line 1: | Line 1: | ||
− | <pre | + | <pre> |
#!/bin/sh | #!/bin/sh | ||
# | # | ||
Line 63: | Line 63: | ||
exit $RETVAL | exit $RETVAL | ||
− | + | </pre> |
Revision as of 15:14, 5 September 2017
#!/bin/sh # # Tomcat Startup Script # # chkconfig: 235 90 90 # description: Loads up the Apache Tomcat Application Server # processname: tomcat # config: /opt/tomcat/conf/server.xml # # Source function library. if [ -x /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions fi RETVAL=0 # Set JAVA_HOME export JAVA_HOME=/usr/java/latest export CATALINA_HOME=/opt/tomcat export IDP_HOME=/opt/idp3 export CATALINA_OPTS="-Didp.home=/opt/idp3 -Xmx512m -XX:MaxPermSize=128m -Dconfig.location.assure.mail=/opt/user-reg-tool/AssureMailConfig20151125.groovy -Dconfig.location.assure.recaptcha=/opt/user-reg-tool /AssureStagingRecaptchaConfig20151125.groovy" # Define the tomcat username TOMCAT_USER="tomcat" # See how we were called. start() { echo -n "Starting $TOMCAT_PROG: " su $TOMCAT_USER $CATALINA_HOME/bin/catalina.sh start RETVAL=$? return $RETVAL } stop() { echo -n "Stopping $TOMCAT_PROG: " su $TOMCAT_USER $CATALINA_HOME/bin/catalina.sh stop sleep 5 if [ -e $CATALINA_HOME/webapps/idp ] ; then rm -rf $CATALINA_HOME/webapps/idp fi } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop sleep 7 start ;; *) echo "Usage: $TOMCAT_PROG {start|stop|restart|condrestart}" exit 1 esac exit $RETVAL