[SunHELP] Getting PIDs

Ben Ricker sunhelp at sunhelp.org
Tue Nov 13 14:02:50 CST 2001


I have a problem. I administer a Web app that is run through a JVM on
Solaris. We are moving to a failover mod where there will be multiple
JVMs running on one machine. The problem I am having is loggin the PIDs
of the processes. Before, I would start the JVM, sleep for 5 seconds,
the pgrep for 'java' and write the returned PID to a file. Now that
there are two JVMs, both PIDs are being written to the file! I tried
separating them out but no joy.

I am able to get the first JVMs PID written to a file. It is when I exec
the second JVM that I get both PIDs written because there are two JVMs
running. I thought I could do some sort of compare of the two PIDs
returned to the file and only write the sequentially later PID, but I am
uncertain how to do that. Any direction would be most appreciated.

Ben Ricker
System Administrator
Wellinx.com






More information about the SunHELP mailing list