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

tomcat-service

Created by mpecher. Last edited by mpecher, 5 years and 169 days ago. Viewed 532 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

no comments | post comment

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< February 2012 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
26272829


Logged in Users: (0)
… and 10 Guests.



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.