Changeset 25443

Show
Ignore:
Timestamp:
19.04.2012 17:57:39 (7 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed the recently added wait-for loop around the stopping of tomcat, so that this takes place after a call to force-stop-tomcat instead of inside force-stop-tomcat.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.xml

    r25437 r25443  
    11211121      <env key="CATALINA_HOME" value="${catalina.home}"/> 
    11221122      <arg line=">nul 2>&amp;1"/> 
    1123     </exec> 
    1124     <!--<antcall target="wait-until-tomcat-stopped"/> 
    1125   </target> 
    1126  
    1127   <target name="wait-until-tomcat-stopped">--> 
    1128     <echo>Waiting for the server to shutdown...</echo> 
    1129     <waitfor maxwait="15" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="tomcat.timedout"> 
    1130       <socket server="${tomcat.server}" port="${tomcat.port}"/> 
    1131     </waitfor> 
    1132  
    1133     <if> 
    1134       <bool> 
    1135     <isset property="${tomcat.timedout}"/> 
    1136       </bool> 
    1137       <property name="tomcat.isrunning" value="true"/> 
    1138       <echo>WARNING: Checked socket 15 times, but port ${tomcat.port} still busy. Going to try to continue anyway...</echo> 
    1139       <else> 
    1140     <echo>Tomcat is stopped.</echo> 
    1141     <property name="tomcat.isrunning" value="false"/> 
    1142       </else> 
    1143     </if> 
     1123    </exec>     
    11441124  </target> 
    11451125 
     
    11571137  </target> 
    11581138 
    1159   <target name="stop-tomcat" description="Shutdown only Tomcat if running"><!-- depends="check-tomcat-running" if="tomcat.isrunning">--> 
     1139  <!-- stop-tomcat checks if the tomcat server is already running. If it appears to be running 
     1140       (regardless of whether tomcat was just starting to shut down), this target calls force-stop-tomcat 
     1141       to issue the shutdown command to tomcat. Then it waits for at most 15 seconds for the server to  
     1142       actually stop by checking the socket at which tomcat listens every second, printing a warning 
     1143       at the end of the max wait time of 15 seconds if tomcat was still running. --> 
     1144  <target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning"> 
    11601145     <antcall target="force-stop-tomcat"/> 
     1146 
     1147     <property name="wait.numchecks" value="15"/> 
     1148     <echo>Waiting for the server to shutdown... (${wait.numchecks} seconds max)</echo> 
     1149     <waitfor maxwait="${wait.numchecks}" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="tomcat.timedout"> 
     1150       <socket server="${tomcat.server}" port="${tomcat.port}"/>        
     1151     </waitfor> 
     1152      
     1153     <if> 
     1154       <bool> 
     1155     <isset property="${tomcat.timedout}"/> 
     1156       </bool> 
     1157       <property name="tomcat.isrunning" value="true"/> 
     1158       <echo>WARNING: Checked the socket ${wait.numchecks} times, but port ${tomcat.port} is still busy.</echo> 
     1159       <else> 
     1160     <echo>Tomcat is stopped.</echo> 
     1161     <property name="tomcat.isrunning" value="false"/> 
     1162       </else> 
     1163     </if> 
    11611164  </target> 
    11621165