2010/11/18 André Warnier <[email protected]>: > I prefer Konstantin's first suggestion. > Now the question is : if Tomcat writes it's PID to that file, where does > Tomcat get it from ? >
Look into catalina.sh echo $! > "$CATALINA_PID" (after spawning java as a background process) BTW, from all methods listed in the comments on [2] http://blog.igorminar.com/2007/03/how-java-application-can-discover-its.html I like the following: int pid = Integer.parseInt( ( new File("/proc/self")).getCanonicalFile().getName() ); There are others as well. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
