Shell acquired through Tomcat process ID and kill the process

#!/bin/bash
echo "begin get tomcat8 pid"

tomcat8_id=$(ps -ef | grep apache-tomcat-8.0.52 | grep -v grep | awk '{print $2}')

echo "tomcat8 pid:$tomcat8_id"

echo "begin kill tomcat8 pid:$tomcat8_id"

kill -9 $tomcat8_id

sleep 3

echo "kill tomcat8 pid:$tomcat8_id,success"

 

Guess you like

Origin www.cnblogs.com/yshyee/p/11604633.html