sometimes if the same pid is running after reboot tomcat will not start
my pid file was at apache-tomcat/temp/tomcat.pid
change file apache-tomcat/bin/catalina.sh about line 386 from "ps -p $PID >/dev/null 2>&1" to "ps -fp $PID |grep catalina >/dev/null 2>&1" as a solution, I just check if the PID is of Catalina
change file apache-tomcat/bin/catalina.sh about line 386
from ps -p $PID >/dev/null 2>&1
to ps -fp $PID |grep catalina >/dev/null 2>&1
excerpt from catalina.sh file
if [ ! -z "$CATALINA_PID" ]; then if [ -f "$CATALINA_PID" ]; then if [ -s "$CATALINA_PID" ]; then echo "Existing PID file found during start." if [ -r "$CATALINA_PID" ]; then PID=`cat "$CATALINA_PID"` ps -fp $PID |grep catalina >/dev/null 2>&1 #this line if [ $? -eq 0 ] ; then echo "Tomcat appears to still be running with PID $PID. Start aborted." echo "If the following process is not a Tomcat process, remove the PID file and try again:" ps -f -p $PID exit 1 else echo "Removing/clearing stale PID file." rm -f "$CATALINA_PID" >/dev/null 2>&1 if [ $? != 0 ]; then if [ -w "$CATALINA_PID" ]; then cat /dev/null > "$CATALINA_PID" else echo "Unable to remove or clear stale PID file. Start aborted." exit 1 fi fi fi else echo "Unable to read PID file. Start aborted."