Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I started a Tomcat7 user instance with tomcat7-instance/bin/startup.sh, but how can I chek if that instance is running or not? Of course, an easier way than with ps | grep.

I know that to check the service status you can use service tomcat7 status, but this is an user instance.

I'm using Ubuntu 12.10 and 13.10.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you installed from repositories then service tomcat7 status should work. Or /etc/init.d/tomcat7 status:

My output from running either of the above commands is below:

Tomcat servlet engine is running with pid 14416.

The way that debian checks is by the below command:

start-stop-daemon --test --start --pidfile /var/run/tomcat7.pid --user tomcat7 --exec /usr/bin/java >/dev/null 2>&1; echo $?

If the value returned is anything but 0 then tomcat is running.

share|improve this answer
    
Is your OS Redhat/Centos? Do you use 3rd party repo, because with official Redhat repo there is no tomcat7 package –  Shâu Shắc Nov 7 '13 at 3:59
    
My example is using Debian Wheezy. –  josten Nov 7 '13 at 4:13
    
The problem is that I want to check this for a tomcat user instance not the service itself. –  Adrian Ber Nov 7 '13 at 9:53
    
Do you have access to start-stop-daemon? If you do then you should be able to run the example I posted above. –  josten Nov 7 '13 at 18:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.