Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 18370 invoked from network); 19 Aug 2002 07:57:44 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Aug 2002 07:57:44 -0000 Received: (qmail 25084 invoked by uid 97); 19 Aug 2002 07:58:18 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 25043 invoked by uid 97); 19 Aug 2002 07:58:17 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 25030 invoked by uid 98); 19 Aug 2002 07:58:16 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) From: "Golden Planet Support" Organization: Golden Planet To: tomcat-dev@jakarta.apache.org Date: Mon, 19 Aug 2002 09:57:31 +0200 MIME-Version: 1.0 Subject: Modified "stop"-script for Linux Message-ID: <3D60C10B.25796.32F6D8@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.01) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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. -- Med venlig hilsen / Best regards Anders C. Madsen Golden Planet Tel.: +45 7020 9594 Dalbygade 40 Fax.: +45 7020 9592 DK-6000 Kolding http://www.goldenplanet.dk -- -- To unsubscribe, e-mail: For additional commands, e-mail: