tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joel Sather" <>
Subject Re: Other question
Date Fri, 14 Jun 2002 14:05:34 GMT

I tried to run Tim's  original sh script under Solaris and it wouldn't
give me anything, so I wrote a version in Perl.  My script looks like


open (PIDFILE, "> logs/");
print PIDFILE getppid();
close (PIDFILE);

I also had to give fully qualified paths in both the Perl script and in
Runtime.getRuntime().exec() to get it to find the correct files.  Use
the original Java class that Tim wrote and just point it to the Perl
script.  Also, just call the Perl script--you don't need to call /bin/sh
first.  Make sure to chmod the script to executable, too.

Thanks for the Java code, Tim.  It works great now.


Joel Sather
phone: 651-917-4719

>>> 06/14/02 07:26AM >>>
Welcome to PID hell! I have this working on HPUX, if you are trying
on another UNIX - I'm not sure what may happen but here are some hints

to track things down.

1) Make sure the directory you are starting tomcat you are typing 
bin/ This ensures you will write the the correct log

2) My original version of the script was:
echo $PPID > logs/

This printed out the wrong PID since the first line created an extra 
shell process for the script to execute in. I wonder if 
Runtime.getRuntime().exec is creating "an extra process" which would 
cause you to get the wrong pid. If that is the case - I can't be of 
help. A Google search will probably provide a better solution than mine

for determining process id of a java program.


Laura wrote:
> Hi,
> I have installed your code in my Tomcat (4.0.2 + apache). 
> But it doesn't seem to be correct. It writes in a PID that
> seem to be correct: I have tried to do:
> kill -9 PID (which is in the 
> and the system tells me:
> bash: kill: (3977) - No such pid
> Where is the problem? 
> Thanks
> Laura

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

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

View raw message