Changeset 25420 for main/trunk/greenstone3/build.xml
- Timestamp:
- 2012-04-18T19:34:18+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.xml
r25418 r25420 1113 1113 called stop-tomcat, now hides the Java exception output that appears whenever tomcat is already 1114 1114 stopped as happens when stop-tomcat is called consecutively. --> 1115 <target name=" stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">1115 <target name="force-stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal"> 1116 1116 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false"> 1117 1117 <env key="CATALINA_HOME" value="${catalina.home}"/> … … 1122 1122 <arg line=">nul 2>&1"/> 1123 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> 1124 1144 </target> 1125 1145 … … 1127 1147 And also use a <waitfor> in place of <condition>, such as: 1128 1148 <waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped"><http url="..."/></waitfor> 1129 The http URL resolves to host:port/greenstone3 --> 1149 The http URL resolves to host:port/greenstone3 1150 Condition uses <http/> rather than <socket/> for testing, since if the server was stopped, the socket 1151 might still be in use for some moments. We test the URL with the http condition since it's likelier to 1152 fail sooner if the server has indeed been stopped. --> 1130 1153 <target name="check-tomcat-running"> 1131 1154 <condition property="tomcat.isrunning"> … … 1134 1157 </target> 1135 1158 1136 < !--<target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning">1159 <target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning"> 1137 1160 <antcall target="force-stop-tomcat"/> 1138 </target> -->1161 </target> 1139 1162 1140 1163 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
Note:
See TracChangeset
for help on using the changeset viewer.