You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Арсений Зинченко <se...@gmail.com> on 2014/05/23 12:03:13 UTC

CATALINA_PID != real PID

Hi, guys.

I set:

$ export CATALINA_PID="$CATALINA_HOME/conf/catalina.pid"

Started *Tomcat*:

$ ./bin/startup.shUsing CATALINA_BASE:
/home/tomcats/apache-tomcat-7.0.53Using CATALINA_HOME:
/home/tomcats/apache-tomcat-7.0.53Using CATALINA_TMPDIR:
/home/tomcats/apache-tomcat-7.0.53/tempUsing JRE_HOME:
/usr/java/jdk1.6.0_45/jre/Using CLASSPATH:
/home/tomcats/apache-tomcat-7.0.53/bin/bootstrap.jar:/home/tomcats/apache-tomcat-7.0.53/bin/tomcat-juli.jarUsing
CATALINA_PID:
/home/tomcats/apache-tomcat-7.0.53/conf/catalina.pidTomcat started.

Checked pid-file:

$ cat /home/tomcats/apache-tomcat-7.0.53/conf/catalina.pid28461

But - there is no process 28461:

$ ps aux | grep 28461
tomcats  28599  0.0  0.0 103240   872 pts/0    S+   12:50   0:00 grep 28461

$ ps -p 28461
  PID TTY          TIME CMD

And Tomcat's JVM runs with other PID:

$ ps u | grep tomcat | grep java | grep -v grep | cut -d" " -f 330133

So - for what exactly CATALINA_PID variable needs or - why it's return
wrong number?

>From "*Tomcat the Definitive Guide*" of *Jason Brittain* book we know that:

CATALINA_PID This variable may optionally hold the path to the process ID
file that Tomcat should use when starting up and shutting down. None

Use:

$ cat /etc/redhat-releaseCentOS release 6.4 (Final)

Thanks for advice.

Re: CATALINA_PID != real PID

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Арсений,

On 5/23/14, 7:24 AM, Арсений Зинченко wrote:
> Hi, Leon.
> 
> Thanks for replay.
> 
> Don't know why - but now it works good :-)

If Tomcat was already running, you might have cloberred your PID file,
but not actually successfully-launched Tomcat. Since this scripts
manage the PID file but can not verify that Tomcat started
successfully, bad things can easily happen in these cases.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTg40EAAoJEBzwKT+lPKRYCp4P/0JNCfjLmK3NsAaHAO6DqP/i
RpATdXeN9TNwxfA0TyT0oZdSFIddyD05ClDt6VloiAbUc38PyC8n0/HACcL4HLU4
Bx9jLAv+HuKxeY48xPdKlagMerG0wDge7CDqo3fH18o+1SpWYjyNJ6ODVyFb23sb
KiM1Nty47Rq6xRu10UJeOJm75DlgSFrojjuHeZPOOEsFlnkOkR3K8H80AtDfLOIy
uuHkNSOz0GgnbjgAeWs1CuXuK5SNwCTE8s5yAUTyFNhqlbrdc99R/xHh8EG56HCE
L7hnkWSiHdn/i6F8l0fkK038w1ZgxI+U86P0NimeRE/TPypavGgK6UqnMENGocOt
E91pTi291V4Innq4fzgwmL28czck3QTks1h8M6SSAkOx2VtAQApgetVB5QIkZK75
XZKPW4DKVRzDJZ+CVWi6hU3wlHuEdlKzM+q3F9JSSKMBZ909R2p5rYCasyWzMywj
s5mBFXpetQ/ClEpjlL3YPf8SG9YQNPY118UPdGaw48JjzSaa8lFkYLyEpD3MM8JH
pAcukIsnTqk+kR5lBo4Mj1uPaciu4IEtK90IeZW7/LMi9ZrzheM7U4OwvoWGHyeg
LaSIuklXOORNvNjWBID4ezg6AZJddu/JjTuG0NUPaDDyIII/YoN1wdKEtOiQCVXJ
yKvR8olc7MZohbztSOzL
=pLQm
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: CATALINA_PID != real PID

Posted by Leon Rosenberg <ro...@gmail.com>.
The usual Heisenbug.

regards
Leon


On Fri, May 23, 2014 at 1:24 PM, Арсений Зинченко <se...@gmail.com>wrote:

> Hi, Leon.
>
> Thanks for replay.
>
> Don't know why - but now it works good :-)
>

Re: CATALINA_PID != real PID

Posted by Арсений Зинченко <se...@gmail.com>.
Hi, Leon.

Thanks for replay.

Don't know why - but now it works good :-)

Re: CATALINA_PID != real PID

Posted by Leon Rosenberg <ro...@gmail.com>.
Hello Arseniy,

I don't know why it doesn't work for you, it works for me:

export CATALINA_PID=/opt/app/tomcat7/pid

*/opt/app/tomcat7*$ more pid

5856

ps aux | grep 5856:

thales    5856  0.0 43.6 642472 228788 ?       Sl   Apr28  29:19
/opt/java/jdk1.7.0_45/bin/java
-Djava.util.logging.config.file=/opt/app/tomcat7/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server
-Xmx256m -Djava.endorsed.dirs=/opt/app/tomcat7/endorsed -classpath
/opt/app/tomcat7/bin/bootstrap.jar:/opt/app/tomcat7/bin/tomcat-juli.jar
-Dcatalina.base=/opt/app/tomcat7 -Dcatalina.home=/opt/app/tomcat7
-Djava.io.tmpdir=/opt/app/tomcat7/temp
org.apache.catalina.startup.Bootstrap start

I am using CATALINA_PID solely to be able to use the force opton:

bin/shutdown.sh -force

for automatical releases from jenkins (the only way I know to wait until
shutdown is finished).

Maybe you have a wrapper script that starts another script, that starts
tomcat, and this is why your pid differ?


regards

Leon


On Fri, May 23, 2014 at 12:03 PM, Арсений Зинченко <se...@gmail.com>wrote:

> Hi, guys.
>
> I set:
>
> $ export CATALINA_PID="$CATALINA_HOME/conf/catalina.pid"
>
> Started *Tomcat*:
>
> $ ./bin/startup.shUsing CATALINA_BASE:
> /home/tomcats/apache-tomcat-7.0.53Using CATALINA_HOME:
> /home/tomcats/apache-tomcat-7.0.53Using CATALINA_TMPDIR:
> /home/tomcats/apache-tomcat-7.0.53/tempUsing JRE_HOME:
> /usr/java/jdk1.6.0_45/jre/Using CLASSPATH:
>
> /home/tomcats/apache-tomcat-7.0.53/bin/bootstrap.jar:/home/tomcats/apache-tomcat-7.0.53/bin/tomcat-juli.jarUsing
> CATALINA_PID:
> /home/tomcats/apache-tomcat-7.0.53/conf/catalina.pidTomcat started.
>
> Checked pid-file:
>
> $ cat /home/tomcats/apache-tomcat-7.0.53/conf/catalina.pid28461
>
> But - there is no process 28461:
>
> $ ps aux | grep 28461
> tomcats  28599  0.0  0.0 103240   872 pts/0    S+   12:50   0:00 grep 28461
>
> $ ps -p 28461
>   PID TTY          TIME CMD
>
> And Tomcat's JVM runs with other PID:
>
> $ ps u | grep tomcat | grep java | grep -v grep | cut -d" " -f 330133
>
> So - for what exactly CATALINA_PID variable needs or - why it's return
> wrong number?
>
> From "*Tomcat the Definitive Guide*" of *Jason Brittain* book we know that:
>
> CATALINA_PID This variable may optionally hold the path to the process ID
> file that Tomcat should use when starting up and shutting down. None
>
> Use:
>
> $ cat /etc/redhat-releaseCentOS release 6.4 (Final)
>
> Thanks for advice.
>