/etc/rc.d/init.d/functions # tomcat name TOMCAT_PORT=$1 TOMCAT=tomcat_$1 TOMCAT_HOME=/opt/tomcats..... --" bash ${TOMCAT_BIN}/startup.sh touch /var/lock/subsys/${TOMCAT_PORT...then echo -n "-- ${TOMCAT} ( pid " ps ax --width=1000 | grep ${TOMCAT_PORT...checkrun if [ $RETVAL -eq 1 ]; then read -p "-- Do you really want to kill ${TOMCAT_PORT...;; *);; esac else echo "-- exist with ${TOMCAT_PORT
step shutdown $Tomcat_port ***" /bin/bash $Project_home/bin/shutdown.sh tomcat_status=`ps -ef |...echo "*** $Tomcat_port auto shutdown succeed!...auto shutdown failed,then should force shutdown $Tomcat_port!...];then echo "*** $Tomcat_port auto shutdown succeed!...auto shutdown failed,then should force shutdown $Tomcat_port!
Tomcat-daemon 此脚本用来通过daemon的方式管理tomcat服务的启动,停止,重启,查看状态和是啥查看日志,具体用法如下: # /etc/init.d/tomcatall tomcat_port...{start|stop|restart|status|log|kill} [root@aniu-video ~]# /etc/init.d/tomcatall tomcat_port args ----.../etc/rc.d/init.d/functions # tomcat name TOMCAT_PORT=$1 TOMCAT=tomcat_$1 TOMCAT_HOME=/data/tomcats...}... --" bash ${TOMCAT_BIN}/startup.sh touch /var/lock/subsys/${TOMCAT_PORT...]; then echo -n "-- ${TOMCAT} ( pid " ps ax --width=1000 | grep ${TOMCAT_PORT
dontKillMe export JAVA_HOME=/usr/src/java8/jdk1.8.0_121 TOMCAT_HOME="/data/tomcat-st/tomcat-st-8002" tomcat_port...=8012 tomcat_pid=`/usr/sbin/lsof -n -P -t -i :$tomcat_port` [ -n "$tomcat_pid" ] && kill -9 $tomcat_pid.../startup.sh echo 'sleep 5s' sleep 5s new_tomcat_pid=`/usr/sbin/lsof -n -P -t -i :$tomcat_port` echo
shell脚本 #针对 项目 放到 /home下,且指向/home/auto-deploy.sh脚本 #tomcat 路径 TOMCAT_HOME=/home/tomcat8 #tomcat 端口 TOMCAT_PORT...check_port() { echo "正在检测Tomcat端口:"$1 netstat -tlpn | grep "\b$1\b" } if check_port $TOMCAT_PORT...then echo $TOMCAT_PORT"端口存在,开始杀死对应PID" kill -9 `ps -ef | grep tomcat | awk 'NR==1 {print...$2}'` else echo $TOMCAT_PORT"端口空闲" fi echo "强制删除tomcat下的项目"$TOMCAT_HOME"/webapps/"$PROJECT_NAME
在浏览器输入“http:localhost:tomcat_port/test即可打开test项目的 index.jsp页面(port是自己的端口号)。
export JAVA_HOME=/opt/software/jdk1.7.0_25 TOMCAT_HOME="/opt/software/apache-tomcat-7.0.59" TOMCAT_PORT
领取专属 10元无门槛券
手把手带您无忧上云