Differences between revisions 2 and 3
Revision 2 as of 2012-07-12 13:10:31
Size: 2262
Editor: HansRamthun
Comment:
Revision 3 as of 2012-07-12 13:11:00
Size: 2250
Editor: HansRamthun
Comment:
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
Line 22: Line 21:
Line 24: Line 22:
Line 26: Line 23:
Line 28: Line 24:
Line 30: Line 25:

Tomcat Start Script in /etc/init.d/tomcat

#!/bin/bash # # BOTH lines (chkconfig,description) needed for chkconfig command! # level: start (99=> very late) stop (01=> very early) # chkconfig: - 99 01 # description: tomcat for vre1 # # tomcat This shell script takes care of starting and stopping tomcat #

# set some environment variables

export DIR=/home/tomcat

export IMPLICC=/gpfs_750/projects/IMPLICC

export JAVA_HOME=${IMPLICC}/jdk1.6.0_25

export CATALINA_HOME=${DIR}/apache-tomcat

if [ -d ${HOME} ] ; then

  • if [ ! -f ${SCRIPT} ]; then
    • echo "${SCRIPT} not available"
    fi

else

  • echo "${HOME} not available" exit

fi

prog="tomcat"

start() {

  • # Start daemons. echo -n "Starting $prog: " $CATALINA_HOME/bin/shutdown.sh $CATALINA_HOME/bin/startup.sh RETVAL=$? return $RETVAL

}

stop() {

  • # Stop daemons. echo -n "Stopping $prog: " $CATALINA_HOME/bin/shutdown.sh RETVAL=$? return $RETVAL

}

# See how we were called.

case "$1" in

  • start)
    • start ;;
    stop)
    • stop ;;
    restart)
    • stop start RETVAL=$? ;;
  • )
    • echo $"Usage: $0 {start|stop|restart}" exit 1

esac

:# adds tomcat to service list

/sbin/chkconfig tomcat on

# adds tomcat to automatic start/stop

/sbin/chkconfig --add tomcat

MadWiki: Tomcat Autostart (last edited 2012-07-12 13:11:00 by HansRamthun)