shutdown-force.sh解决tomcat无法正常关闭需要手动kill问题。
在tomcat/bin下创建shutdown-force.sh
set fileformat=unix
#!/bin/bash
#force shutdown tomcat,copy this sh file to tomcat/bin dir
path=$(dirname $0)
echo "exec $path/shutdown.sh"
$path/shutdown.sh
sleep 3s
#kill -9 pid
echo "Kill tomcat! pid:" `ps -ef|grep $path|grep java|awk '{print $2}'`
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}'
来源:oschina
链接:https://my.oschina.net/u/1241069/blog/672902