首页 > 代码库 > 强制关闭tomcat sh脚本

强制关闭tomcat sh脚本

shutdown-force.sh解决tomcat无法正常关闭需要手动kill问题。

把shutdown-force.sh放到tomcat/bin目录下,强制关闭tomcat:

cd tomcat/bin./shutdown-force.sh

sh脚本内容:

set fileformat=unix#!/bin/bash#by lym6520 2014-11-08#force shutdown tomcat,copy this sh file to tomcat/bin dirpath=${PWD}ps -ef|grep $path|grep java|awk ‘{print $2}‘echo "exec $path/shutdown.sh"$path/shutdown.shsleep 3s#kill -9 pidps -ef|grep $path|grep java|awk ‘{print $2}‘|xargs kill -9#success msgecho "shutdown success"ps -ef|grep $path|grep java|awk ‘{print $2}‘
  • 本文来自:Linux技术网
  • 本文链接:http://www.ahlinux.com/tomcat/9329.html
 

强制关闭tomcat sh脚本