shutdown-force.sh解決tomcat沒法正常關閉須要手動kill問題。
把shutdown-force.sh放到tomcat/bin目錄下,強制關閉tomcat:java
cd tomcat/bin ./shutdown-force.sh
sh腳本內容:shell
set fileformat=unix #!/bin/bash #force shutdown tomcat,copy this sh file to tomcat/bin dir path=${PWD} ps -ef|grep $path|grep java|awk '{print $2}' echo "exec $path/shutdown.sh" $path/shutdown.sh sleep 3s #kill -9 pid ps -ef|grep $path|grep java|awk '{print $2}'|xargs kill -9 #success msg echo "shutdown success" ps -ef|grep $path|grep java|awk '{print $2}'