Is Tomcat running?

ziggy picture ziggy · Oct 15, 2010 · Viewed 490.3k times · Source

Interested to know how people usually check to see if Tomcat is running on a Unix environment.

I either check that the process is running using

ps -ef | grep java
ps -ef | grep logging

or i check that the port number is active

netstat -a | grep 8080

is there a better way of checking that Tomcat is running? The above seem to be to be a 'hacky' way of checking that Tomcat is running.

Answer

Thai Tran picture Thai Tran · Aug 9, 2012

On my linux system, I start Tomcat with the startup.sh script. To know whether it is running or not, i use

ps -ef | grep tomcat  

If the output result contains the whole path to my tomcat folder, then it is running