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.