#!/bin/bash # # tomcat This shell script takes care of starting and stopping # all tomcat sites # edit the SITES variable to include a list of all tomcat # sites to startup. These tomcat instances will run as # the same user which owns the final path folder # # # # # chkconfig: - 96 30 # description: Tomcat # processname: java # config: /etc/httpd/conf/httpd.conf # pidfile: /var/run/tomcat.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network SITES="/home/coptot/liferay/tomcat" RETVAL=0 start() { for i in $SITES; do /etc/rc.d/init.d/sitestart.sh $i RETVAL=$? done echo [ $RETVAL = 0 ] && touch /var/lock/subsys/tomcat return $RETVAL } stop() { for i in $SITES; do /etc/rc.d/init.d/sitestop.sh $i RETVAL=$? done echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat /var/run/tomcat.pid } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; condrestart) if [ -f /var/run/tomcat.pid ] ; then stop start fi ;; *) echo $"Usage: tomcat {start|stop|restart|condrestart}" exit 1 esac exit $RETVAL