Tomcat进程无法正常stop问题
September 20th, 2017
No comments
CentOS使用Catalina.sh 来管理Tomcat运行时,Catalina.sh run 之后产生的tomcat进程会无法使用 Catalina.sh stop -force关闭。如果Catalina.sh的默认内容来配置tomcat服务,/etc/init.d/tomcat stop 也将会失效
查看Catalina.sh文件后找到以下代码,原来需要stop的话,需要CATALINA_PID文件配合。
Catalina.sh 468行
if [ ! -z "$CATALINA_PID" ]; then if [ -f "$CATALINA_PID" ]; then if [ -s "$CATALINA_PID" ]; then kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1 if [ $? -gt 0 ]; then echo "PID file found but no matching process was found. Stop aborted." exit 1 fi else echo "PID file is empty and has been ignored." fi else echo "\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted." exit 1 fi fi |
Recent Comments