How to shut down tomcat in linux

WBOY
Release: 2022-03-25 09:14:17
Original
15701 people have browsed it

Close method: 1. Use the "cd bin directory path under Tomcat" command to enter the bin directory under Tomcat; 2. Use the "./shutdown.sh" command to shut down the Tomcat service; 3. Use "kill - 9 process number" command to forcefully shut down the Tomcat process.

How to shut down tomcat in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to shut down tomcat in Linux

In Linux system, use commands to start and shut down Tomcat.

Enter the bin directory under Tomcat

cd /java/tomcat/bin
Copy after login

Stop Tomcat service command

./shutdown.sh
Copy after login

After executing tomcat ./shutdown.sh, although the tomcat service cannot be accessed normally, ps - After ef | grep tomcat, it was found that the java process corresponding to tomcat was not destroyed when the web container was closed, and there was a zombie java process. After reading online, the reason for the zombie process may be that there are non-daemon threads (i.e. User Thread), and the jvm will not exit (when all threads in the JVM are daemon threads, the JVM can exit; if there is another or above non-daemon threads, the JVM will not exit). Use the following command to check whether the Tomcat process has ended:

ps -ef|grep tomcat
Copy after login

If similar information is displayed, it means that the Tomcat process has not ended

gateway  14705 14703 12 08:29 pts/0    00:03:10 /www/websoft/java/java1/jdk1.7.0_25/jre/bin/java -Djava.util.logging.config.file=/www/websoft/tomcat1/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xms1536m -Xmx1536m -Xss256k -XX:MaxPermSize=512m -XX:+UseParallelGC -XX:ParallelGCThreads=20 -XX:+UseParallelOldGC -XX:MaxGCPauseMillis=100 -XX:+UseAdaptiveSizePolicy -Djava.endorsed.dirs=/endorsed -classpath /www/websoft/tomcat1/bin/bootstrap.jar:/www/websoft/tomcat1/bin/tomcat-juli.jar -Dcatalina.base=/www/websoft/tomcat1 -Dcatalina.home=/www/websoft/tomcat1 -Djava.io.tmpdir=/www/websoft/tomcat1/temp org.apache.catalina.startup.Bootstrap start
Copy after login

At this time we can forcefully terminate the process (zombie process)

kill -9 14705
Copy after login

After the previous command is executed, check the Tomcat process again. Tomcat has completely stopped.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to shut down tomcat in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template