The Tomcat servlet module is not running, but the pid file exists. what does this message mean? Do I need to restore Tomcat if I get it?

I am making a shell script to restart tomcat after a crash. Interestingly, I need to process this message in my script "The Tomcat servlet engine is not running, but the pid file exists." what does this message mean? Should I consider this as an error message that obliges me to restart Tomcat?

My script looks like this:

#!/bin/bash
SERVICE=/etc/init.d/tomcat7
STOPPED_MESSAGE=" * Tomcat servlet container is not running."  
PID_FILE_MESSAGE=" * Tomcat servlet engine is not running, but pid file exists."

if [ "`$SERVICE status`" == "$STOPPED_MESSAGE" ];
then  
{
    $SERVICE start
}
else
    if [ "`$SERVICE status`" == "$PID_FILE_MESSAGE" ];
    then
    {
        $SERVICE restart
    }
    fi
fi
+5
source share
2 answers

PID. PID - , . Tomcat CATALINA_PID, , PID Tomcat . , Tomcat, , (, ) PID .

, Tomcat , ( CATALINA_PID) .

@jordanm () : Tomcat , , .

, jsvc, Tomcat .

+4

, tomcat. "java.net.BindException: " cataline.out.

Soultion: java pid killall -9 java tomcat.

.

+1

All Articles