title: How to avoid running more than one instance of apache tomcat
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>I am also not able to stop tomcat using shutdown script.</p>
  
  <p>I want to run only one instance of tomcat. If anyone try to run more than one instance it should be automatically shutdown.</p>
  
  <p>Could anyone tell how to handle this situation?</p>
  
  <p>Any suggestion will be really helpful.</p>
  
  <p>Thanks in advance !!</p>
  
  <p>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<br>
  tcp        0      0 :::8009                     :::*                        LISTEN      8320/java<br>
  tcp        0      0 :::22222                    :::*                        LISTEN      8320/java<br>
  tcp        0      0 :::8080                     :::*                        LISTEN      8320/java<br>
  udp        0      0 :::40161                    :::*                                    8320/java<br>
  udp        0      0 ::ffff:192.168.122.108:11007 :::*                                    8320/java </p>
  
  <p>After calling shutdown script Bootstrap process is still shown in jps. And it was using below ports:
  udp        0      0 :::40161                    :::*                                    8320/java</p>
  
  <p>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.</p>
  
  <p>Any idea how to do that?</p>