Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 41079 invoked from network); 13 Jun 2002 15:07:31 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Jun 2002 15:07:31 -0000 Received: (qmail 7750 invoked by uid 97); 13 Jun 2002 15:07:11 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 7693 invoked by uid 97); 13 Jun 2002 15:07:10 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 7681 invoked by uid 98); 13 Jun 2002 15:07:10 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <3D08B517.3080306@joedog.org> Date: Thu, 13 Jun 2002 11:07:03 -0400 From: Tim Funk Organization: Human being User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Other question References: <01ff01c212bc$6520df80$5be94cc1@pisa.iol.it> <003e01c212e8$e99f5080$117a48c7@rickspc> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N For what its worth - I created (and use) a LifecycleListener that runs on startup which logs the process ID into a file called tomcat.pid. Which is created by a shell script called writepid.sh. Below is all the code to get this to work. This code also assumes your current working directory is $CATALINA_HOME. --Begin code import org.apache.catalina.LifecycleEvent; /** * A helper for getting the PID of java so shutting down tomcat is MUCH * easier. */ public class PidLifeCycle implements org.apache.catalina.LifecycleListener { public void lifecycleEvent(LifecycleEvent event) { if ("start".equals(event.getType())) { try { Runtime.getRuntime().exec("/bin/sh bin/writepid.sh"); } catch(Throwable e) { e.printStackTrace(); } } } } --End Code The code above will launch the following shell script. Should be in the bin/ directory of your tomcat installation. --Begin Shell script echo $PPID > logs/tomcat.pid --End Shell script Then add the following into server.xml --Begin server.xml snippet --End server.xml snippet -Tim Rick Fincher wrote: > Hi Laura, > > Tomcat actually does have a pid. It is a java application. Under Solaris > if you do a ps -elf |grep nativ you will see a listing beginning with your > JAVA_HOME and ending with ../bin/sparc/nativ_t. That's the pid of the java > virtual machine. If you have multiple java apps running each will have a > JVM so you may need to sort out which java pid is Tomcat. > > You can also use top after starting Tomcat. You will see an entry for java > in the table along with the pid and memory and cpu usage info. > > Rick > -- To unsubscribe, e-mail: For additional commands, e-mail: