[ start | index | login ]
start > bidz > tomcat > tomcat-service

tomcat-service

Created by mpecher. Last edited by mpecher, 5 years and 279 days ago. Viewed 534 times. #1
[edit] [rdf]
labels
attachments
#       This is the init script for starting up the
#               Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#

# Source function library. . /etc/init.d/functions

# Get config. #. /etc/sysconfig/network

# Check that networking is up. #[ "${NETWORKING}" = "no" ] && exit 0

umask 077

start(){ echo -n $"Starting Tomcat service: " export JAVA_HOME="/usr/java/jdk1.5.0_08" daemon /usr/java/apache-tomcat-5.5.17/bin/startup.sh RETVAL=$? echo }

stop(){ echo -n $"Stopping Tomcat service: " export JAVA_HOME="/usr/java/jdk1.5.0_08" daemon /usr/java/apache-tomcat-5.5.17/bin/shutdown.sh RETVAL=$? echo }

status(){ numproc=`ps -ef | grep tomcat | grep -v "grep itomcat" | wc -l` if [ $numproc -gt 0 ]; then echo "Tomcat is running..." else echo "Tomcat is stopped..." fi }

restart(){ stop start }

# See how we were called. case "$1" in start) start ;; stop) stop ;; status) status ;; restart|reload) restart ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 1 esac

exit 0

Please login to post a comment.

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< May 2012 >
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031


Logged in Users: (0)
… and a Guest.



Disclaimer: Views and opinions are that of the individual author, and not that of Marand Custom Solutions. This site is an open forum for technical content, and the company accepts no liability for any content or view expressed.