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, Арсений Зинченко <setev...@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. >