Few dayz ago for one of my work on the freeBSD server, i wanted to check if the tomcat server was running. As in a live server, if the server is not running, whats the point of keeping the server? So i wanted to make sure if the tomcat is running from command-line and run if it is dead. But figuring out the aliveness of the tomcat was the hard part, rest was the shell script. One of my friend said, it will be hard one cause tomcat runs on JVM. I thought there much be a way, so i kept searching. At last, i got a widget which works something like a remote controller for the tomcat server.
Which can be found with name: Tomcat Collar 1.1
But the magic line was this one:
ps -w -A -w |grep "org.apache.catalina.startup.Bootstrap start"
if this returns you something, that means tomcat is alive and …. 🙂
i guess this might save someones wild searching time, like i did for several days.