We can either stop the JBoSS Server or kill the process using kill -9 . If there are multiple JVM process running on the server then it is better to have a script that will do at one shot .
refer below sample script that help to kill all the jboss process running on with path jboss-eap-6.4/ . For you environment identify the unique keyword to get the individual process then pass to kill -9 command as given below .
#!/bin/bash
# For different version update keyword correctly go get jboss process like jboss-eap-7.x
procCount=`ps -ef |grep "jboss-eap-6.4/" |grep -v grep |wc -l`
if [ $procCount -gt 0 ] ; then
ps -ef |grep "jboss-eap-6.4/" |grep -v grep | awk '{ print $2 }' |xargs kill -9 2>&1
if [ $? -eq 0 ] ; then
echo -e " JBOSS Master Stopped successfully"
else
echo -e " Unable to stop ..please check"
fi
else
echo "Jboss is not running .."
fi
No comments:
Post a Comment