Changeset 25418 for main/trunk/greenstone3/build.xml
- Timestamp:
- 2012-04-18T15:49:46+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.xml
r25384 r25418 1107 1107 1108 1108 <!-- windows: do we want to launch a webrowser?? --> 1109 <!-- shouldn't this test whether anything is running first? --> 1110 <target name="force-stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal"> 1109 <!-- shouldn't this test whether anything is running first? 1110 It's safer to always attempt to stop tomcat: that way we won't be dependent on the right time 1111 to check whether the server is stopped or still running before attempting to start again. 1112 This target, which was recently called force-stop-tomcat for a while but is back to being 1113 called stop-tomcat, now hides the Java exception output that appears whenever tomcat is already 1114 stopped as happens when stop-tomcat is called consecutively. --> 1115 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal"> 1111 1116 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false"> 1112 1117 <env key="CATALINA_HOME" value="${catalina.home}"/> 1118 <arg line=">/dev/null 2>&1"/> 1113 1119 </exec> 1114 1120 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false"> 1115 1121 <env key="CATALINA_HOME" value="${catalina.home}"/> 1116 </exec> 1117 </target> 1118 1119 <target name="check-tomcat-running"><!--if you update this target, may want to change similar elements in config-admin--> 1120 <!--can also try the "socket" condition in place of the "http" condition--> 1121 <condition property="tomcat.isrunning"><!--<waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped">--> 1122 <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/> <!--host:port/greenstone3--> 1123 </condition><!--</waitfor>--> 1124 </target> 1125 1126 <target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning"> 1122 <arg line=">nul 2>&1"/> 1123 </exec> 1124 </target> 1125 1126 <!-- Can also try the "socket" condition in place of the "http" condition 1127 And also use a <waitfor> in place of <condition>, such as: 1128 <waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped"><http url="..."/></waitfor> 1129 The http URL resolves to host:port/greenstone3 --> 1130 <target name="check-tomcat-running"> 1131 <condition property="tomcat.isrunning"> 1132 <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/> 1133 </condition> 1134 </target> 1135 1136 <!--<target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning"> 1127 1137 <antcall target="force-stop-tomcat"/> 1128 </target> 1129 1138 </target>--> 1130 1139 1131 1140 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/> … … 1216 1225 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 1217 1226 But you can do: echo mypassword | ant config-admin --> 1218 <target name="update-userdb" description="Add or modify users"> 1219 <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time 1220 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html --> 1221 <!--<antcall target="check-tomcat-running"/>--><!--won't set the tomcat.isrunning property for use below--> 1222 <condition property="tomcat.isrunning"> 1223 <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/><!--can also try the "socket" condition in place of the "http" condition--> 1224 </condition> 1227 <target name="update-userdb" description="Add or modify users" depends="check-tomcat-running"> 1228 1229 <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time 1230 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html 1231 The ${tomcat.isrunning} property is set by the depends-target "check-tomcat-running" --> 1225 1232 <if> 1226 1233 <bool> 1227 1234 <istrue value="${tomcat.isrunning}"/> 1228 1235 </bool> 1229 <antcall target=" force-stop-tomcat"/>1236 <antcall target="stop-tomcat"/> 1230 1237 </if> 1231 1238
Note:
See TracChangeset
for help on using the changeset viewer.