标签:tomcat启动脚本
#!/bin/bash # chkconfig: 2345 80 12 # processname: market_tomcat source /etc/init.d/functions [ -r "$SYSCONFIG" ] && source "$SYSCONFIG" RETVAL=0 TOMCAT_NAME=market_tomcat start() { pid=`ps -ef |grep $TOMCAT_NAME|grep -v grep|wc -l` if [ $pid -ne 0 ];then echo "market already running...." exit 1 fi echo -n $"Starting $TOMCAT_NAME: " daemon /data/$TOMCAT_NAME/bin/catalina.sh start RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$TOMCAT_NAME return $RETVAL } stop() { echo -n $"Stop $TOMCAT_NAME:" daemon /data/$TOMCAT_NAME/bin/shutdown.sh if [ `ps -ef |grep $TOMCAT_NAME|grep -v grep |wc -l` -ne 0 ];then ps -ef |grep $TOMCAT_NAME|grep -v grep |awk ‘{print $2}‘|xargs kill -9 fi RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -rf /var/lock/subsys/$TOMCAT_NAME return $RETVAL } restart() { stop sleep 5 start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; esac exit $RETVAL
本文出自 “秋小秋” 博客,请务必保留此出处http://heygirl32895.blog.51cto.com/7623150/1622231
标签:tomcat启动脚本
原文地址:http://heygirl32895.blog.51cto.com/7623150/1622231