2

I set:

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

Started Tomcat:

$ ./bin/startup.sh
Using CATALINA_BASE:   /home/tomcats/apache-tomcat-7.0.53
Using CATALINA_HOME:   /home/tomcats/apache-tomcat-7.0.53
Using CATALINA_TMPDIR: /home/tomcats/apache-tomcat-7.0.53/temp
Using 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.jar
Using CATALINA_PID:    /home/tomcats/apache-tomcat-7.0.53/conf/catalina.pid
Tomcat started.

Checked pid-file:

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

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 3
30133

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-release
CentOS release 6.4 (Final)

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

Close question - after few restarts/kills it is now works good... Don't know why.

setevoy
  • 4,374
  • 11
  • 50
  • 87
  • 3
    > So - for what exactly CATALINA_PID variable needs or - why it's return wrong number? // sorry, it is not "real question"? and about blog - I just pass all info, which I have, to to give a complete picture. – setevoy May 23 '14 at 10:22
  • The purpose is for the file in CATALINA_PID to contain the pid of tomcat. If that's not happening, there's a bug somewhere. – nos May 23 '14 at 10:32
  • 1
    I have tested your scenario but could not reproduce it. Do you have more than one tomcat running by a chance? Have you made any custom modifications to `catalina.sh`? Any other deviations from vanilla Tomcat? – mindas May 23 '14 at 15:47
  • @maindas Thanks - but it's works now. Don't know why - but after few restarts works. P.S. under this user - runs only one Tomact; catalina.sh - without modifications. – setevoy May 23 '14 at 20:44

0 Answers0