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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11754

Synchronous shutdown script - shutdown.sh should wait until Tomcat is fully shut down





------- Additional Comments From [EMAIL PROTECTED]  2002-08-19 18:13 -------
Anders Madsen posts the following workaround for Linux (tomcat-dev, 19 Aug 2002).  

Note that this is merely a patch for the init.d script.  A solution built in to
the stop script itself would be more versatile.

---


From: "Golden Planet Support" <[EMAIL PROTECTED]>                        
                                                                       
Organization: Golden Planet                                                    
                                                                        To:
[EMAIL PROTECTED]                                                  
                                                                    Date: Mon,
19 Aug 2002 09:57:31 +0200                                                     
                                                             Subject: Modified
"stop"-script for Linux                                                        
                                                      Priority: normal         
                                                                               
                                              X-mailer: Pegasus Mail for Windows
(v4.01)                                                                        
                                     X-Spam-Rating: daedalus.apache.org 1.6.2
0/1000/N                                                                       
                               
Hello All

I have noticed that the /etc/init.d/tomcat4 script still contains
what is described as an "Ugly hack" - a short two second pause when
restarting the service instead of something that confirms that all
threads have been shut down.

A while ago I modified my own script to conatain the following lines -
 perhaps they could be of some use for others, I don't know. I am by
no means an experienced coder so please bear with me if this is not
the most elegant solution - it just works for me... ;-)

stop() {
    echo -n "Stopping $TOMCAT_PROG: "
    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=$?
    echo

    echo 'Waiting for java threads to finish...'
    threads=1
    until [ $threads = '0' ]
                do
                ps -aux | grep $TOMCAT_USER -c > /tmp/threads
                read threads < /tmp/threads
    done
    rm -f /tmp/threads
    echo 'Java threads cleaned up - shutdown complete.'

    [ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat4
/var/run/tomcat4.pid
}                                                                              
                                                                        
The above works on a x86 RedHat 7.1 - I don't know if things may work
differently on other systems.

---

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to