You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Raghu GS <ra...@i10n.com> on 2011/09/27 11:34:25 UTC

catalina_pid file contains +1 pid number instead of correct pid

Hello Everybody

We are using Tomcat 6.20 in CentOS 5.3 server.
I have recently enabled catalina_pid functionality using environment
variable.
The PID file got created and contains +1 PID number.

If the Tomcat's real PID number 5446, the pid file would contain 5447 as PID
number.
Please help me to resolve this problem as we are using tomcat in 10 of our
servers.

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32521407.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Raghu GS <ra...@i10n.com>.
If upgrading tomcat in our setup is that easy, i wouldn't have asked for help
here.
We are running tomcat in production server with large customer base.
We don't want to do radical changes to fix one problem.


Pid * wrote:
> 
> On 29/09/2011 06:30, Raghu GS wrote:
>> 
>> 
>> 
>> Konstantin Kolinko wrote:
>>>
>>> 2011/9/27 Raghu GS <ra...@i10n.com>:
>>>>
>>>> Hello Everybody
>>>>
>>>> We are using Tomcat 6.20 in CentOS 5.3 server.
>>>
>>> 6.0.20 ??
>>>
>>> You should read
>>> http://tomcat.apache.org/security-6.html
>>>
>>> as well as all the fixed issues in changelog.
>>>
>>>> I have recently enabled catalina_pid functionality using environment
>>>> variable.
>>>> The PID file got created and contains +1 PID number.
>>>>
>>>> If the Tomcat's real PID number 5446, the pid file would contain 5447
>>>> as
>>>> PID
>>>> number.
>>>
>>> catalina.sh is a shell script file. There are not many secrets there
>>> and it is editable.
>>> You should try to debug what really goes on on your system.
>>>
>>> IIRC there were some talks about using "exec" command vs "eval"
>>> command  in the script to launch the process.
>>>
>>> Anyway, if CATALINA_PID file were not working I think somebody would
>>> report it, but 6.0.20 was so old ago and I do not remember such
>>> reports.
>>>
>>>> Please help me to resolve this problem as we are using tomcat in 10 of
>>>> our
>>>> servers.
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> Actually the PID number in the PID file is not wildly incorrect.
>> So, please suggest me an easy to implement solution.
> 
> Upgrade to the latest 6.0.33 and try again?
> 
> 
> p
> 
> 
> 
> 
>  
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32560326.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Pid <pi...@pidster.com>.
On 29/09/2011 06:30, Raghu GS wrote:
> 
> 
> 
> Konstantin Kolinko wrote:
>>
>> 2011/9/27 Raghu GS <ra...@i10n.com>:
>>>
>>> Hello Everybody
>>>
>>> We are using Tomcat 6.20 in CentOS 5.3 server.
>>
>> 6.0.20 ??
>>
>> You should read
>> http://tomcat.apache.org/security-6.html
>>
>> as well as all the fixed issues in changelog.
>>
>>> I have recently enabled catalina_pid functionality using environment
>>> variable.
>>> The PID file got created and contains +1 PID number.
>>>
>>> If the Tomcat's real PID number 5446, the pid file would contain 5447 as
>>> PID
>>> number.
>>
>> catalina.sh is a shell script file. There are not many secrets there
>> and it is editable.
>> You should try to debug what really goes on on your system.
>>
>> IIRC there were some talks about using "exec" command vs "eval"
>> command  in the script to launch the process.
>>
>> Anyway, if CATALINA_PID file were not working I think somebody would
>> report it, but 6.0.20 was so old ago and I do not remember such
>> reports.
>>
>>> Please help me to resolve this problem as we are using tomcat in 10 of
>>> our
>>> servers.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> Actually the PID number in the PID file is not wildly incorrect.
> So, please suggest me an easy to implement solution.

Upgrade to the latest 6.0.33 and try again?


p




Re: catalina_pid file contains +1 pid number instead of correct pid

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

Raghu,

On 9/30/2011 8:26 AM, Raghu GS wrote:
> Thanks for showing your interest in helping me resolve the issue. 
> Do you want me to post bash/shell output or catalina.out file's
> output?

If you had just posted both of them, you might have an answer by now.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6GABcACgkQ9CaO5/Lv0PBs8gCfbjOSSf0cPreZBeekeFkDZgPH
XXcAnAss3YeW8VYdHDYjPbw3Scnbb/z8
=8etT
-----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 file contains +1 pid number instead of correct pid

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

Michael,

On 10/28/2011 8:43 AM, Cooper man wrote:
> And this is a bit of a hack but something like this will give you
> the correct pid. Set application.name or soehting similar as a jave
> env variable and then
> 
> if [ ! -z "$CATALINA_PID" ]; then ps aux | grep tomcat  | grep
> application.name=YOUR_APP_NAME | head -n 1 | awk '{ print $2 }' >
> $CATALINA_PID


Some *NIX's have a program called "pidof" which might be helpful. If
you run many processes with the same, it might not be so helpful.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6rCxQACgkQ9CaO5/Lv0PBDXQCeNbb9Yo2HJKgxNPCoCrrzbTwj
4MIAmQES9A7tQxJxonrfAdLxz292xkXz
=GuGg
-----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 file contains +1 pid number instead of correct pid

Posted by Konstantin Kolinko <kn...@gmail.com>.
Maybe you can get somewhere looking at the parent process ID (PPID)
column in ps output
and knowing the PID of cronolog process.

Best regards,
Konstantin Kolinko

2011/10/28 Cooper man <mi...@spika.com>:
>
> The danger with that is if you have multiple jvms running on one machine as
> we do, you will get a list of ids
>
>
> Raghu GS wrote:
>>
>> Thank you so much for coming up with a solution for this problem.
>> I found a better hack for this problem here
>> http://www.tomcatexpert.com/comment/reply/249/220
>>
>>
>> Cooper man wrote:
>>>
>>> No problem , glad I can be of help as it took me so long to figure it out
>>> too
>>>
>>>
>>> You need to change the block where the pid is assigned which should be
>>> just under the line I described
>>>
>>>  if [ ! -z "$CATALINA_PID" ]; then
>>>
>>>       fi
>>>
>>> And this is a bit of a hack but something like this will give you the
>>> correct pid.
>>> Set application.name or soehting similar as a jave env variable and then
>>>
>>>  if [ ! -z "$CATALINA_PID" ]; then
>>>         ps aux | grep tomcat  | grep application.name=YOUR_APP_NAME |
>>> head -n 1 | awk '{ print $2 }' > $CATALINA_PID
>>>       fi
>>>
>>>
>>>
>>>
>>>
>>> Raghu GS wrote:
>>>>
>>>> Hi Cooper Man
>>>>
>>>> You are a genius.
>>>> you have perfectly guessed our setup and problem.
>>>> And I am very happy about finding the root cause finally.
>>>> Is there any solution for this problem?
>>>>
>>>> Cooper man wrote:
>>>>>
>>>>> Hi Raghu,
>>>>>
>>>>> My guess is that you have changed the logging to use cronolog and as
>>>>> such the PID being written is actually the logging process and not the
>>>>> catalina process. Check your catalina.sh file
>>>>> If you see something like this
>>>>>
>>>>> org.apache.catalina.startup.Bootstrap "$@" start 2>&1
>>>>> |/usr/bin/cronolog "$CATALINA_BASE"
>>>>>
>>>>> Then there is your answer
>>>>>
>>>>>
>
>

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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Cooper man <mi...@spika.com>.
The danger with that is if you have multiple jvms running on one machine as
we do, you will get a list of ids


Raghu GS wrote:
> 
> Thank you so much for coming up with a solution for this problem.
> I found a better hack for this problem here
> http://www.tomcatexpert.com/comment/reply/249/220
> 
> 
> Cooper man wrote:
>> 
>> No problem , glad I can be of help as it took me so long to figure it out
>> too
>> 
>> 
>> You need to change the block where the pid is assigned which should be
>> just under the line I described 
>> 
>>  if [ ! -z "$CATALINA_PID" ]; then
>> 
>>       fi
>> 
>> And this is a bit of a hack but something like this will give you the
>> correct pid.
>> Set application.name or soehting similar as a jave env variable and then 
>> 
>>  if [ ! -z "$CATALINA_PID" ]; then
>>         ps aux | grep tomcat  | grep application.name=YOUR_APP_NAME |
>> head -n 1 | awk '{ print $2 }' > $CATALINA_PID
>>       fi
>> 
>> 
>> 
>> 
>> 
>> Raghu GS wrote:
>>> 
>>> Hi Cooper Man
>>> 
>>> You are a genius. 
>>> you have perfectly guessed our setup and problem.
>>> And I am very happy about finding the root cause finally.
>>> Is there any solution for this problem? 
>>> 
>>> Cooper man wrote:
>>>> 
>>>> Hi Raghu,
>>>> 
>>>> My guess is that you have changed the logging to use cronolog and as
>>>> such the PID being written is actually the logging process and not the
>>>> catalina process. Check your catalina.sh file 
>>>> If you see something like this 
>>>> 
>>>> org.apache.catalina.startup.Bootstrap "$@" start 2>&1
>>>> |/usr/bin/cronolog "$CATALINA_BASE"
>>>> 
>>>> Then there is your answer
>>>> 
>>>> 
>>>> Raghu GS wrote:
>>>>> 
>>>>> Thanks for showing your interest in helping me resolve the issue.
>>>>> Do you want me to post bash/shell output or catalina.out file's
>>>>> output?
>>>>> 
>>>>> 
>>>>> Christopher Schultz-2 wrote:
>>>>>> 
>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>>> Hash: SHA1
>>>>>> 
>>>>>> Raghu,
>>>>>> 
>>>>>> On 9/29/2011 1:30 AM, Raghu GS wrote:
>>>>>>>>> I have recently enabled catalina_pid functionality using
>>>>>>>>> environment variable. The PID file got created and contains +1
>>>>>>>>> PID number.
>>>>>> 
>>>>>> So, when you look at the PID file you get, say "1235" but when you
>>>>>> run
>>>>>> a "ps" you see your JVM process is PID "1234"?
>>>>>> 
>>>>>> I'm surprised that's the case. I would buy that the pid of the
>>>>>> /script/ was "1234" and that the JVM is "1235" but I guess strange
>>>>>> things can sometimes happen.
>>>>>> 
>>>>>>> Actually the PID number in the PID file is not wildly incorrect. 
>>>>>>> So, please suggest me an easy to implement solution.
>>>>>> 
>>>>>> We're not entirely sure of the problem, so coming up with a solution
>>>>>> isn't going to be terribly easy.
>>>>>> 
>>>>>> Can you show us what happens when you do this:
>>>>>> 
>>>>>> $ bin/shutdown.sh
>>>>>> $ bin/startup.sh
>>>>>> $ cat "$CATALINA_PID"
>>>>>> $ ps aux | grep 'java\PID'
>>>>>> 
>>>>>> - -chris
>>>>>> -----BEGIN PGP SIGNATURE-----
>>>>>> Version: GnuPG v1.4.10 (MingW32)
>>>>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>>>>> 
>>>>>> iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
>>>>>> EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
>>>>>> =zVEw
>>>>>> -----END PGP SIGNATURE-----
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32738842.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Raghu GS <ra...@i10n.com>.
Thank you so much for coming up with a solution for this problem.
I found a better hack for this problem here
http://www.tomcatexpert.com/comment/reply/249/220


Cooper man wrote:
> 
> No problem , glad I can be of help as it took me so long to figure it out
> too
> 
> 
> You need to change the block where the pid is assigned which should be
> just under the line I described 
> 
>  if [ ! -z "$CATALINA_PID" ]; then
> 
>       fi
> 
> And this is a bit of a hack but something like this will give you the
> correct pid.
> Set application.name or soehting similar as a jave env variable and then 
> 
>  if [ ! -z "$CATALINA_PID" ]; then
>         ps aux | grep tomcat  | grep application.name=YOUR_APP_NAME | head
> -n 1 | awk '{ print $2 }' > $CATALINA_PID
>       fi
> 
> 
> 
> 
> 
> Raghu GS wrote:
>> 
>> Hi Cooper Man
>> 
>> You are a genius. 
>> you have perfectly guessed our setup and problem.
>> And I am very happy about finding the root cause finally.
>> Is there any solution for this problem? 
>> 
>> Cooper man wrote:
>>> 
>>> Hi Raghu,
>>> 
>>> My guess is that you have changed the logging to use cronolog and as
>>> such the PID being written is actually the logging process and not the
>>> catalina process. Check your catalina.sh file 
>>> If you see something like this 
>>> 
>>> org.apache.catalina.startup.Bootstrap "$@" start 2>&1 |/usr/bin/cronolog
>>> "$CATALINA_BASE"
>>> 
>>> Then there is your answer
>>> 
>>> 
>>> Raghu GS wrote:
>>>> 
>>>> Thanks for showing your interest in helping me resolve the issue.
>>>> Do you want me to post bash/shell output or catalina.out file's output?
>>>> 
>>>> 
>>>> Christopher Schultz-2 wrote:
>>>>> 
>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>> Hash: SHA1
>>>>> 
>>>>> Raghu,
>>>>> 
>>>>> On 9/29/2011 1:30 AM, Raghu GS wrote:
>>>>>>>> I have recently enabled catalina_pid functionality using
>>>>>>>> environment variable. The PID file got created and contains +1
>>>>>>>> PID number.
>>>>> 
>>>>> So, when you look at the PID file you get, say "1235" but when you run
>>>>> a "ps" you see your JVM process is PID "1234"?
>>>>> 
>>>>> I'm surprised that's the case. I would buy that the pid of the
>>>>> /script/ was "1234" and that the JVM is "1235" but I guess strange
>>>>> things can sometimes happen.
>>>>> 
>>>>>> Actually the PID number in the PID file is not wildly incorrect. 
>>>>>> So, please suggest me an easy to implement solution.
>>>>> 
>>>>> We're not entirely sure of the problem, so coming up with a solution
>>>>> isn't going to be terribly easy.
>>>>> 
>>>>> Can you show us what happens when you do this:
>>>>> 
>>>>> $ bin/shutdown.sh
>>>>> $ bin/startup.sh
>>>>> $ cat "$CATALINA_PID"
>>>>> $ ps aux | grep 'java\PID'
>>>>> 
>>>>> - -chris
>>>>> -----BEGIN PGP SIGNATURE-----
>>>>> Version: GnuPG v1.4.10 (MingW32)
>>>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>>>> 
>>>>> iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
>>>>> EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
>>>>> =zVEw
>>>>> -----END PGP SIGNATURE-----
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32738120.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Cooper man <mi...@spika.com>.
No problem , glad I can be of help as it took me so long to figure it out too


You need to change the block where the pid is assigned which should be just
under the line I described 

 if [ ! -z "$CATALINA_PID" ]; then

      fi

And this is a bit of a hack but something like this will give you the
correct pid.
Set application.name or soehting similar as a jave env variable and then 

 if [ ! -z "$CATALINA_PID" ]; then
        ps aux | grep tomcat  | grep application.name=YOUR_APP_NAME | head
-n 1 | awk '{ print $2 }' > $CATALINA_PID
      fi





Raghu GS wrote:
> 
> Hi Cooper Man
> 
> You are a genius. 
> you have perfectly guessed our setup and problem.
> And I am very happy about finding the root cause finally.
> Is there any solution for this problem? 
> 
> Cooper man wrote:
>> 
>> Hi Raghu,
>> 
>> My guess is that you have changed the logging to use cronolog and as such
>> the PID being written is actually the logging process and not the
>> catalina process. Check your catalina.sh file 
>> If you see something like this 
>> 
>> org.apache.catalina.startup.Bootstrap "$@" start 2>&1 |/usr/bin/cronolog
>> "$CATALINA_BASE"
>> 
>> Then there is your answer
>> 
>> 
>> Raghu GS wrote:
>>> 
>>> Thanks for showing your interest in helping me resolve the issue.
>>> Do you want me to post bash/shell output or catalina.out file's output?
>>> 
>>> 
>>> Christopher Schultz-2 wrote:
>>>> 
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>> 
>>>> Raghu,
>>>> 
>>>> On 9/29/2011 1:30 AM, Raghu GS wrote:
>>>>>>> I have recently enabled catalina_pid functionality using
>>>>>>> environment variable. The PID file got created and contains +1
>>>>>>> PID number.
>>>> 
>>>> So, when you look at the PID file you get, say "1235" but when you run
>>>> a "ps" you see your JVM process is PID "1234"?
>>>> 
>>>> I'm surprised that's the case. I would buy that the pid of the
>>>> /script/ was "1234" and that the JVM is "1235" but I guess strange
>>>> things can sometimes happen.
>>>> 
>>>>> Actually the PID number in the PID file is not wildly incorrect. 
>>>>> So, please suggest me an easy to implement solution.
>>>> 
>>>> We're not entirely sure of the problem, so coming up with a solution
>>>> isn't going to be terribly easy.
>>>> 
>>>> Can you show us what happens when you do this:
>>>> 
>>>> $ bin/shutdown.sh
>>>> $ bin/startup.sh
>>>> $ cat "$CATALINA_PID"
>>>> $ ps aux | grep 'java\PID'
>>>> 
>>>> - -chris
>>>> -----BEGIN PGP SIGNATURE-----
>>>> Version: GnuPG v1.4.10 (MingW32)
>>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>>> 
>>>> iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
>>>> EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
>>>> =zVEw
>>>> -----END PGP SIGNATURE-----
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32737967.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Raghu GS <ra...@i10n.com>.
Hi Cooper Man

You are a genius. 
you have perfectly guessed our setup and problem.
And I am very happy about finding the root cause finally.
Is there any solution for this problem? 

Cooper man wrote:
> 
> Hi Raghu,
> 
> My guess is that you have changed the logging to use cronolog and as such
> the PID being written is actually the logging process and not the catalina
> process. Check your catalina.sh file 
> If you see something like this 
> 
> org.apache.catalina.startup.Bootstrap "$@" start 2>&1 |/usr/bin/cronolog
> "$CATALINA_BASE"
> 
> Then there is your answer
> 
> 
> Raghu GS wrote:
>> 
>> Thanks for showing your interest in helping me resolve the issue.
>> Do you want me to post bash/shell output or catalina.out file's output?
>> 
>> 
>> Christopher Schultz-2 wrote:
>>> 
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>> 
>>> Raghu,
>>> 
>>> On 9/29/2011 1:30 AM, Raghu GS wrote:
>>>>>> I have recently enabled catalina_pid functionality using
>>>>>> environment variable. The PID file got created and contains +1
>>>>>> PID number.
>>> 
>>> So, when you look at the PID file you get, say "1235" but when you run
>>> a "ps" you see your JVM process is PID "1234"?
>>> 
>>> I'm surprised that's the case. I would buy that the pid of the
>>> /script/ was "1234" and that the JVM is "1235" but I guess strange
>>> things can sometimes happen.
>>> 
>>>> Actually the PID number in the PID file is not wildly incorrect. 
>>>> So, please suggest me an easy to implement solution.
>>> 
>>> We're not entirely sure of the problem, so coming up with a solution
>>> isn't going to be terribly easy.
>>> 
>>> Can you show us what happens when you do this:
>>> 
>>> $ bin/shutdown.sh
>>> $ bin/startup.sh
>>> $ cat "$CATALINA_PID"
>>> $ ps aux | grep 'java\PID'
>>> 
>>> - -chris
>>> -----BEGIN PGP SIGNATURE-----
>>> Version: GnuPG v1.4.10 (MingW32)
>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>> 
>>> iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
>>> EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
>>> =zVEw
>>> -----END PGP SIGNATURE-----
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32735655.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Cooper man <mi...@spika.com>.
Hi Raghu,

My guess is that you have changed the logging to use cronolog and as such
the PID being written is actually the logging process and not the catalina
process. Check your catalina.sh file 
If you see something like this 

org.apache.catalina.startup.Bootstrap "$@" start 2>&1 |/usr/bin/cronolog
"$CATALINA_BASE"

Then there is your answer


Raghu GS wrote:
> 
> Thanks for showing your interest in helping me resolve the issue.
> Do you want me to post bash/shell output or catalina.out file's output?
> 
> 
> Christopher Schultz-2 wrote:
>> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> Raghu,
>> 
>> On 9/29/2011 1:30 AM, Raghu GS wrote:
>>>>> I have recently enabled catalina_pid functionality using
>>>>> environment variable. The PID file got created and contains +1
>>>>> PID number.
>> 
>> So, when you look at the PID file you get, say "1235" but when you run
>> a "ps" you see your JVM process is PID "1234"?
>> 
>> I'm surprised that's the case. I would buy that the pid of the
>> /script/ was "1234" and that the JVM is "1235" but I guess strange
>> things can sometimes happen.
>> 
>>> Actually the PID number in the PID file is not wildly incorrect. 
>>> So, please suggest me an easy to implement solution.
>> 
>> We're not entirely sure of the problem, so coming up with a solution
>> isn't going to be terribly easy.
>> 
>> Can you show us what happens when you do this:
>> 
>> $ bin/shutdown.sh
>> $ bin/startup.sh
>> $ cat "$CATALINA_PID"
>> $ ps aux | grep 'java\PID'
>> 
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>> 
>> iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
>> EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
>> =zVEw
>> -----END PGP SIGNATURE-----
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32731093.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Raghu GS <ra...@i10n.com>.
Thanks for showing your interest in helping me resolve the issue.
Do you want me to post bash/shell output or catalina.out file's output?


Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Raghu,
> 
> On 9/29/2011 1:30 AM, Raghu GS wrote:
>>>> I have recently enabled catalina_pid functionality using
>>>> environment variable. The PID file got created and contains +1
>>>> PID number.
> 
> So, when you look at the PID file you get, say "1235" but when you run
> a "ps" you see your JVM process is PID "1234"?
> 
> I'm surprised that's the case. I would buy that the pid of the
> /script/ was "1234" and that the JVM is "1235" but I guess strange
> things can sometimes happen.
> 
>> Actually the PID number in the PID file is not wildly incorrect. 
>> So, please suggest me an easy to implement solution.
> 
> We're not entirely sure of the problem, so coming up with a solution
> isn't going to be terribly easy.
> 
> Can you show us what happens when you do this:
> 
> $ bin/shutdown.sh
> $ bin/startup.sh
> $ cat "$CATALINA_PID"
> $ ps aux | grep 'java\PID'
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
> EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
> =zVEw
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32564438.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

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

Raghu,

On 9/29/2011 1:30 AM, Raghu GS wrote:
>>> I have recently enabled catalina_pid functionality using
>>> environment variable. The PID file got created and contains +1
>>> PID number.

So, when you look at the PID file you get, say "1235" but when you run
a "ps" you see your JVM process is PID "1234"?

I'm surprised that's the case. I would buy that the pid of the
/script/ was "1234" and that the JVM is "1235" but I guess strange
things can sometimes happen.

> Actually the PID number in the PID file is not wildly incorrect. 
> So, please suggest me an easy to implement solution.

We're not entirely sure of the problem, so coming up with a solution
isn't going to be terribly easy.

Can you show us what happens when you do this:

$ bin/shutdown.sh
$ bin/startup.sh
$ cat "$CATALINA_PID"
$ ps aux | grep 'java\PID'

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6EkTQACgkQ9CaO5/Lv0PCXPQCfbsvgBvgDP85OKgFVrkJ9Lb6L
EWgAn2zBw4rPnqAkMKvP19gzI11ZGSCq
=zVEw
-----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 file contains +1 pid number instead of correct pid

Posted by Raghu GS <ra...@i10n.com>.


Konstantin Kolinko wrote:
> 
> 2011/9/27 Raghu GS <ra...@i10n.com>:
>>
>> Hello Everybody
>>
>> We are using Tomcat 6.20 in CentOS 5.3 server.
> 
> 6.0.20 ??
> 
> You should read
> http://tomcat.apache.org/security-6.html
> 
> as well as all the fixed issues in changelog.
> 
>> I have recently enabled catalina_pid functionality using environment
>> variable.
>> The PID file got created and contains +1 PID number.
>>
>> If the Tomcat's real PID number 5446, the pid file would contain 5447 as
>> PID
>> number.
> 
> catalina.sh is a shell script file. There are not many secrets there
> and it is editable.
> You should try to debug what really goes on on your system.
> 
> IIRC there were some talks about using "exec" command vs "eval"
> command  in the script to launch the process.
> 
> Anyway, if CATALINA_PID file were not working I think somebody would
> report it, but 6.0.20 was so old ago and I do not remember such
> reports.
> 
>> Please help me to resolve this problem as we are using tomcat in 10 of
>> our
>> servers.
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

Actually the PID number in the PID file is not wildly incorrect.
So, please suggest me an easy to implement solution.
-- 
View this message in context: http://old.nabble.com/catalina_pid-file-contains-%2B1-pid-number-instead-of-correct-pid-tp32521407p32550880.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: catalina_pid file contains +1 pid number instead of correct pid

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/27 Raghu GS <ra...@i10n.com>:
>
> Hello Everybody
>
> We are using Tomcat 6.20 in CentOS 5.3 server.

6.0.20 ??

You should read
http://tomcat.apache.org/security-6.html

as well as all the fixed issues in changelog.

> I have recently enabled catalina_pid functionality using environment
> variable.
> The PID file got created and contains +1 PID number.
>
> If the Tomcat's real PID number 5446, the pid file would contain 5447 as PID
> number.

catalina.sh is a shell script file. There are not many secrets there
and it is editable.
You should try to debug what really goes on on your system.

IIRC there were some talks about using "exec" command vs "eval"
command  in the script to launch the process.

Anyway, if CATALINA_PID file were not working I think somebody would
report it, but 6.0.20 was so old ago and I do not remember such
reports.

> Please help me to resolve this problem as we are using tomcat in 10 of our
> servers.
>

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