You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/01/10 12:22:19 UTC

DO NOT REPLY [Bug 33027] New: - catalina.sh - give shutdown some time before killing with -force option

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33027>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33027

           Summary: catalina.sh - give shutdown some time before killing
                    with -force option
           Product: Tomcat 5
           Version: 5.5.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P4
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: horombo@gmx.de


The 'if [ "$1" = "-force" ]' branch of the stop command doesn't give the started
Catalina instance any time to shutdown normally, because immediately after
telling Catalina via socket to shutdown it kills the process the hard way.
Adding a sleep with a reasonable delay gives the started Catalina instance time
to shutdown cleanly.

The following code snippet adds this delay, a check whether Catalina is still
running (perhaps there's no need to kill) and a removal of the pid file after
all is done (no stale pid):

if [ $FORCE -eq 1 ]; then
  if [ ! -z "$CATALINA_PID" ]; then
    sleep 3
    if [ kill -0 `cat $CATALINA_PID` 2>/dev/null ]; then
      echo "Killing: `cat $CATALINA_PID`"
      kill -9 `cat $CATALINA_PID`
    fi
    rm -f $CATALINA_PID
  fi
fi

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org