原因:关闭后实际jvm进程没有推出,但是端口释放了,没有推出的原因是有非守护进程没有退出,导致jvm没有推出,导致tomcat启动的进程没有结束
解决办法:把tomcat的启动进程pid保存下来,shutdown的时候把这个pid强制关掉
//添加CATALINA_PID
[root@localhost pc1]# vi bin/catalina.sh
# CATALINA_PID (Optional) Path of the file which should contains the pid
# of the catalina startup java process, when start (fork) is
# used
CATALINA_PID=/project/pid/pc1/CATALINA_PID
//创建目录
[root@localhost pc1]# mkdir -p /project/pid/pc1/
//设置强制关闭,修改尾行添加 -force
[root@localhost pc1]# vi bin/shutdown.sh
...
exec "$PRGDIR"/"$EXECUTABLE" stop -force "$@"
//startup.sh shutdown.sh 测试通过