How to Solve The Process Still Exsit after Tomcat Shutdown

Reason: After shutdown the actual jvm process is not launched, but the port is released, the reason for not launching is that there are non-daemon processes that do not exit, resulting in jvm not launched, resulting in tomcat startup process is not finished
Solution: Save the pid of the tomcat startup process, and force the pid to be turned off during shutdown.

//add 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

//Create a directory
[root@localhost pc1]# mkdir -p /project/pid/pc1/

//Set force close, modify trailing line to add -force
[root@localhost pc1]# vi  bin/shutdown.sh

...
exec "$PRGDIR"/"$EXECUTABLE" stop -force "$@"


//startup.sh  shutdown.sh  Test Pass

Similar Posts: