tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How to get java process id of a user running tomcat
Date Wed, 02 Dec 2009 20:40:13 GMT
Hash: SHA1


On 12/2/2009 1:30 AM, raj kumar wrote:
> When i ran tomcat and shut it down my java process is not closing along with
> shutdown.

See others' responses for why you should have to do this. Otherwise...

> i need to kill it explicitly. So  I would like to know how to
> identify the java process of the logged in user who started the server. so
> that i can kill the process id from the script itself.

You won't be using the script to kill Tomcat unless you hack
it up to do that. I'd recommend against that.

What I would recommend is using the CATALINA_PID environment variable
helpfully documented in bin/

# Environment Variable Prequisites
#   CATALINA_PID    (Optional) Path of the file which should contains
#                   the pid of catalina startup java process, when
#                   start (fork) is used

Try setting this environment variable to something like
"/var/run/" and you should get a file in that location
containing the pid of the Java process started by Tomcat.

Then, you can do something like:

$ kill -9 `cat /var/run/`

Forget all these ridiculous suggestions of running 'ps' and grepping the
output for all kinds of crazy strings. That may or may not work at all.
The above strategy was intended by the Tomcat developers to be used to
capture the PID of the Java process, so go ahead and use that.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message