I am using apache-tomcat-7.0.41 on linux environment. In normal cases(when tomcat don't have any app i.e. war file in webapps directory), only when one instance of tomcat can be run. If we try to run more than one instance of tomcat using startup script then process automatically shutdown because of port bind exception.

But when i put my app's war file in webapps directory then startup script instantiate a new tomcat instance each time when startup script is run. For example if i run 2 times startup script then in jps 2 Bootstrap processes are shown.

I am also not able to stop tomcat using shutdown script.

I want to run only one instance of tomcat. If anyone try to run more than one instance it should be automatically shutdown.

Could anyone tell how to handle this situation?

Any suggestion will be really helpful.

Thanks in advance !!

When i am running tomcat then its pid is 8320 and it is using below ports:
tcp 0 0 ::ffff:127.0.0.1:8005 :::\* LISTEN 8320/java  

tcp 0 0 :::8009 :::\* LISTEN 8320/java  

tcp 0 0 :::22222 :::\* LISTEN 8320/java  

tcp 0 0 :::8080 :::\* LISTEN 8320/java  

udp 0 0 :::40161 :::\* 8320/java  

udp 0 0 ::ffff:192.168.122.108:11007 :::\* 8320/java 

After calling shutdown script Bootstrap process is still shown in jps. And it was using below ports:
udp 0 0 :::40161 :::\* 8320/java

22222 and 11007 ports are used by my application and that is shutdown but only one udp port is not released even after calling shutdown script.

Any idea how to do that?