#!/bin/bash
#
# tomcat Start/Stop the Tomcat Http/Servlet server.
#
# chkconfig: 2345 95 65
# description: Tomcat is a java based HTTP/Servlet server
# processname: tomcat
# pidfile: /var/run/tomcat.pid
#CATALINA_HOME=/usr/local/tomcat; export CATALINA_HOME
JAVA_HOME=/jdk경로/; export JAVA_HOME
TOMCAT_OWNER=root; export TOMCAT_OWNER
CATALINA=/톰캣경로/bin/
start() {
echo -n "Starting Tomcat: "
su $TOMCAT_OWNER -c $CATALINA\/startup.sh
sleep 2
}
stop() {
echo -n "Stopping Tomcat: "
su $TOMCAT_OWNER -c $CATALINA\/shutdown.sh
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: tomcat {start|stop|restart}"
exit
esac