Answer the question
In order to leave comments, you need to log in
Auto restart apache tomcat on heap space?
What parameter should be set in catalina.sh to automatically restart tomcat at heap space.
I know there is a setting
-XX:OnOutOfMemoryError=\"touch /tmp/tomcat_suicide;kill -9 %p\"
but it just kills the process.
Answer the question
In order to leave comments, you need to log in
Let him kill.
in cron:
*/1 * * * * ~/tmp/check_tomcat.sh >> ~/tmp/check_tomcat.sh.log 2>&1
cat ~/tmp/check_tomcat.sh
#!/bin/bash
if [ $( ps -ef|grep tomcat|grep java|wc -l ) -eq 0 ]
then
echo "tomcat process not found, try to start"
service tomcat start
else
echo "tomcat process found"
fi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question