#!/bin/sh
# Tomcat6 startup daemon
# chkconfig 2345 20 80
# description: Tomcat6 service
# Provides: Tomcat
# Default-start: 2 3 4 5
# Default-stop: 0 1 6
# Short-Description: start and stop Tomcat
# Description: start and stop Tomcat service
PATH="$PATH:"
JAVA_HOME="/opt/java"
TOMCAT_HOME="/opt/tomcat6"
CLASSPATH="$CLASSPATH:"
JAVA_OPTS="-server -Xmx2048M -XX:PermSize=256M -Djava.awt.headless=true"
export PATH JAVA_HOME TOMCAT_HOME CLASSPATH JAVA_OPTS
# See how we were called.
start(){
#/usr/bin/killall java > /dev/null
echo -n "Starting Tomcat"
$TOMCAT_HOME/bin/startup.sh >> $TOMCAT_HOME/logs/stdout.log 2>&1
echo
touch /var/lock/subsys/tomcat
}
stop(){
echo -n "Shutting down Tomcat"
$TOMCAT_HOME/bin/shutdown.sh >> $TOMCAT_HOME/logs/stdout.log
echo
rm -f /var/lock/subsys/tomcat
rm -f /var/run/tomcat.pid
}
restart(){
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
# Tomcat6 startup daemon
# chkconfig 2345 20 80
# description: Tomcat6 service
# Provides: Tomcat
# Default-start: 2 3 4 5
# Default-stop: 0 1 6
# Short-Description: start and stop Tomcat
# Description: start and stop Tomcat service
PATH="$PATH:"
JAVA_HOME="/opt/java"
TOMCAT_HOME="/opt/tomcat6"
CLASSPATH="$CLASSPATH:"
JAVA_OPTS="-server -Xmx2048M -XX:PermSize=256M -Djava.awt.headless=true"
export PATH JAVA_HOME TOMCAT_HOME CLASSPATH JAVA_OPTS
# See how we were called.
start(){
#/usr/bin/killall java > /dev/null
echo -n "Starting Tomcat"
$TOMCAT_HOME/bin/startup.sh >> $TOMCAT_HOME/logs/stdout.log 2>&1
echo
touch /var/lock/subsys/tomcat
}
stop(){
echo -n "Shutting down Tomcat"
$TOMCAT_HOME/bin/shutdown.sh >> $TOMCAT_HOME/logs/stdout.log
echo
rm -f /var/lock/subsys/tomcat
rm -f /var/run/tomcat.pid
}
restart(){
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0