View | Details | Raw Unified | Return to bug 54013
Collapse All | Expand All

(-)bin/catalina.sh (-3 / +17 lines)
Lines 471-476 Link Here
471
    fi
471
    fi
472
  fi
472
  fi
473
473
474
  KILL_SLEEP_INTERVAL=5
474
  if [ $FORCE -eq 1 ]; then
475
  if [ $FORCE -eq 1 ]; then
475
    if [ -z "$CATALINA_PID" ]; then
476
    if [ -z "$CATALINA_PID" ]; then
476
      echo "Kill failed: \$CATALINA_PID not set"
477
      echo "Kill failed: \$CATALINA_PID not set"
Lines 479-487 Link Here
479
        PID=`cat "$CATALINA_PID"`
480
        PID=`cat "$CATALINA_PID"`
480
        echo "Killing Tomcat with the PID: $PID"
481
        echo "Killing Tomcat with the PID: $PID"
481
        kill -9 $PID
482
        kill -9 $PID
482
        rm -f "$CATALINA_PID" >/dev/null 2>&1
483
        while [ $KILL_SLEEP_INTERVAL -ge 0 ]; do
483
        if [ $? != 0 ]; then
484
            kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1
484
          echo "Tomcat was killed but the PID file could not be removed."
485
            if [ $? -gt 0 ]; then
486
                rm -f "$CATALINA_PID" >/dev/null 2>&1
487
                if [ $? != 0 ]; then
488
                    echo "Tomcat was killed but the PID file could not be removed."
489
                fi
490
                break
491
            fi
492
            if [ $KILL_SLEEP_INTERVAL -gt 0 ]; then
493
                sleep 1
494
            fi
495
            KILL_SLEEP_INTERVAL=`expr $KILL_SLEEP_INTERVAL - 1 `
496
        done
497
        if [ $KILL_SLEEP_INTERVAL -gt 0 ]; then
498
            echo "Tomcat did not get killed completely just yet. The process might be waiting on some system call or might be UNINTERRUPTIBLE."
485
        fi
499
        fi
486
      fi
500
      fi
487
    fi
501
    fi

Return to bug 54013