一、修改bin/catalina.sh文件
java
查找PRGDIR=dirname "$PRG"
這一行;
在這一行的下面增長語句:linux
if [ -z "$CATALINA_PID" ]; then CATALINA_PID=$PRGDIR/CATALINA_PID cat $CATALINA_PID fi
功能:判斷 CATALINA_PID有沒有配置,
沒有的話,就使用當前目錄(bin)
的CATALINA_PID文件來記錄tomcat的進程ID
二、修改tomcat的shutdown.sh文件,在最後一行加上「-force」:
找到命令行: exec "$PRGDIR"/"$EXECUTABLE" stop "$@"
修改成:exec "$PRGDIR"/"$EXECUTABLE" stop -force "$@"
保存便可。bootstrap
三、結果展現tomcat
root@i70l5wbwtduhmchqwZ:/usr/java/tomcat-7.0.92/bin# ./startup.sh Using CATALINA_BASE: /usr/java/tomcat-7.0.92 Using CATALINA_HOME: /usr/java/tomcat-7.0.92 Using CATALINA_TMPDIR: /usr/java/tomcat-7.0.92/temp Using JRE_HOME: /usr/java/jdk1.8.0_191 Using CLASSPATH: /usr/java/tomcat-7.0.92/bin/bootstrap.jar:/usr/java/tomcat-7.0.92/bin/tomcat-juli.jar Using CATALINA_PID: ./CATALINA_PID Tomcat started. root@i70l5wbwtduhmchqwZ:/usr/java/tomcat-7.0.92/bin# ./shutdown.sh Using CATALINA_BASE: /usr/java/tomcat-7.0.92 Using CATALINA_HOME: /usr/java/tomcat-7.0.92 Using CATALINA_TMPDIR: /usr/java/tomcat-7.0.92/temp Using JRE_HOME: /usr/java/jdk1.8.0_191 Using CLASSPATH: /usr/java/tomcat-7.0.92/bin/bootstrap.jar:/usr/java/tomcat-7.0.92/bin/tomcat-juli.jar Using CATALINA_PID: ./CATALINA_PID Tomcat stopped.