Tomcat shutdown is invalid in linux. tomcatshutdown
Problem:
Tomcat shutdown is invalid in linux.
After tomcat is disabled in linux, it is found that the port number is occupied after Tomcat is restarted,
Cause:
This may be because the background thread or socket in the project is still running and the port number is occupied,
Solution:
①: Run $ netstat-pan | grep 2809 to check the port number,
You can use netstat-anp | grep 3306 to find the port number and kill the current PID process.
②: Disable the port through iptables
Iptables-a input-p tcp -- dport 111-j DROP
③: Disable port: lsof-I: 8080 | grep-v "PID" | awk '{print "kill-9", $2}' | sh
④: Repeated shutdown. sh can also be effective!
In linux, when I run shutdownsh, the tomcat service stops running, but the jdk PROCESS OF THE tomcat application is not stopped,
In general, shutdown. sh can be used to stop java processes. Sometimes it may take several dozen seconds for the java Process to be shut down. But sometimes the java Process will always exist due to java program problems, the process can only be killed. In this case, it seems that there is no other way to optimize the java program.
LZ must wait until the java Process of the existing tomcat is turned off and start tomcat again. Do not start multiple tomcat; otherwise, your application may have problems ----- the server port will be occupied by the previous process, tomcat started later does not work.
Why did I receive an error when I stopped tomcat in linux?
Catalina. out is missing.
You can create such a file by yourself.