tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Crider" <Simone.Cri...@noaa.gov>
Subject Could not kill/shutdown tomcat/java processes
Date Wed, 14 May 2003 20:25:32 GMT
Hello,

Within the last few days, we deployed the latest binary version of
tomcat 4.1.24, on a RH Linux 7.1 platform,

# rpm -qa |grep tomcat
tomcat4-4.1.24-full.2jpp

We found that once we had the configuration correct & tomcat
successfully started, that we could not successfully stop the tomcat
processes via the linux startup/shutdown script w/in /etc/rc.d/init.d/. 
We were forced to kill all processes manually, which at times were many.

After searching the tomcat user's archives, found a couple of users that
also were having the same type problem.  However, there were either no
recommended solution or nothing that related to the problem that we had
encountered.  Long story short, found a typo w/in the startup/shutdown
script, /etc/rc.d/init.d/tomcat4.  The tomcat processes are not getting
killed due to the typo.  See the following section of the script & the
line commented as "typo".

>>>

stop() {
    echo -n "Stopping $TOMCAT_PROG: "

    if [ -f /var/lock/subsys/tomcat4 ] ; then
      if [ -x /etc/rc.d/init.d/functions ]; then
          daemon --user $TOMCAT_USER $TOMCAT_SCRIPT stop
      else
          su - $TOMCAT_USER -c "$TOMCAT_SCRIPT stop"
      fi
      RETVAL=$?

      if [ $RETVAL = 0 ]; then
        count=0;

        if [ -f /var/run/tomcat4.pid ]; then

            read kpid < /var/run/tomcat4.pid
            let kwait=$SHUTDOWN_WAIT

            until [ `ps --pid $kpid | grep -c $kpid` = '0' ] || [ $count
-gt $kwait ]
            do
                echo "waiting for processes to exit";
                sleep 1
                let count=$count+1;
            done

            if [ $count -gt $kwait ]; then
                echo "killing processes which didn't stop after
$SHUTDOWN_WAIT seconds"
### typo                kill -9 $kipd
                kill -9 $kpid
            fi
        fi
    
                rm -f /var/lock/subsys/tomcat4 /var/run/tomcat4.pid
    fi

    fi
}

>>>

Once corrected, all processes appear to properly shutdown.  The script
now functions correctly as in previous versions of tomcat.

I hope this info will be helpful.

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


Mime
View raw message