From: <rv...@us...> - 2009-11-17 16:08:22
|
Revision: 272 http://treebase.svn.sourceforge.net/treebase/?rev=272&view=rev Author: rvos Date: 2009-11-17 16:08:08 +0000 (Tue, 17 Nov 2009) Log Message: ----------- Script used to test whether tomcat was down by calling /usr/bin/GET, changed this to use curl (or a drop-in replacement if needed), which is more portable. For example, /usr/bin/GET was unavailable on treebasedb-dev.nescent.org, because LWP is not installed system-wide Modified Paths: -------------- trunk/treebase-core/src/main/perl/misc/publish Modified: trunk/treebase-core/src/main/perl/misc/publish =================================================================== --- trunk/treebase-core/src/main/perl/misc/publish 2009-11-17 04:28:48 UTC (rev 271) +++ trunk/treebase-core/src/main/perl/misc/publish 2009-11-17 16:08:08 UTC (rev 272) @@ -16,6 +16,12 @@ die '$CATALINA_HOME unset' fi +# This used to be hardcoded for /usr/bin/GET, but that requires +# LWP to be installed system-wide, which is rarer than just +# having curl somewhere. In any case, the required API for this +# command is to return a non-zero exit code when attempting to +# get a URL yields a 404 or other error. +GETCMD="curl -s -o /dev/null" WEBAPPS="$CATALINA_HOME/webapps" TARGET_DIR="treebase-web" @@ -50,7 +56,7 @@ # Stop the server, and make sure it's dead before proceeding ${CATALINA_HOME}/bin/catalina.sh stop -if /usr/bin/GET -d $TOMCAT_URL ; then +if $GETCMD $TOMCAT_URL ; then die 'Failed to stop tomcat at $TOMCAT_URL' fi @@ -68,7 +74,7 @@ # Restart the server, and die if it doesn't start right away ${CATALINA_HOME}/bin/catalina.sh start sleep 3 -if /usr/bin/GET -d $TOMCAT_URL ; then +if $GETCMD $TOMCAT_URL ; then : # okay else die 'Failed to restart tomcat at $TOMCAT_URL' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |