From 5ef4fe28e381a0f874c5a1e790d9a454c27c8484 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Mon, 5 May 2008 12:58:12 +0000 Subject: [PATCH] LMS-401 bug fixing distribution script and startup script SVN: 5906 --- dataset_download/build/build.xml | 17 +++++++++---- dataset_download/dist/download-service.sh | 24 ++++++++++-------- .../{ => dist}/etc/jetty-keystore | Bin dataset_download/dist/etc/log.xml | 2 +- dataset_download/dist/etc/openBIS.keystore | Bin 0 -> 653 bytes dataset_download/dist/etc/service.properties | 9 ++++--- dataset_download/dist/log/.gitignore | 0 dataset_download/etc/service.properties | 2 +- .../DatasetDownloadService.java | 2 +- .../DatasetDownloadServlet.java | 3 +++ 10 files changed, 37 insertions(+), 22 deletions(-) rename dataset_download/{ => dist}/etc/jetty-keystore (100%) create mode 100644 dataset_download/dist/etc/openBIS.keystore create mode 100644 dataset_download/dist/log/.gitignore diff --git a/dataset_download/build/build.xml b/dataset_download/build/build.xml index 843932049d3..e2a7faf96d8 100644 --- a/dataset_download/build/build.xml +++ b/dataset_download/build/build.xml @@ -3,11 +3,12 @@ <project-classpath name="ecp" classes="${classes}" /> <property name="original.dist" value="dist" /> - <property name="mainfolder" value="download-service" /> + <property name="name" value="download-server"/> + <property name="mainfolder" value="${name}" /> <property name="dist.download-service" value="${dist}/${mainfolder}" /> <property name="dist.download-service.lib" value="${dist.download-service}/lib" /> - <property name="jar.file" value="${dist.download-service.lib}/download-service.jar" /> - <property name="dist.file.prefix" value="${dist}/download-service" /> + <property name="jar.file" value="${dist.download-service.lib}/${name}.jar" /> + <property name="dist.file.prefix" value="${dist}/${name}" /> <property name="lib" value="../libraries" /> <target name="clean"> @@ -32,9 +33,9 @@ <include name="${build.info.filename}" /> </fileset> <manifest> - <attribute name="Main-Class" value="ch.systemsx.cisd.datasetdownload.DatasetDownloadService" /> + <attribute name="Main-Class" value="ch.systemsx.cisd.openbis.datasetdownload.DatasetDownloadService" /> <attribute name="Class-Path" - value="jetty.jar jetty-util.jar servlet-api-2.5.jar log4j.jar commons-lang.jar commons-io.jar" /> + value="${name}.jar jetty.jar jetty-util.jar servlet-api-2.5.jar log4j.jar commons-codec.jar commons-logging.jar commons-httpclient.jar commons-lang.jar commons-io.jar activation.jar mail.jar spring.jar" /> <attribute name="Version" value="${version.number}" /> <attribute name="Build-Number" value="${version.number} (r${revision.number},${clean.flag})" /> </manifest> @@ -42,12 +43,18 @@ </target> <target name="dist" depends="jar"> + <copy file="${lib}/activation/activation.jar" todir="${dist.download-service.lib}" /> + <copy file="${lib}/mail/mail.jar" todir="${dist.download-service.lib}" /> + <copy file="${lib}/spring/spring.jar" todir="${dist.download-service.lib}" /> <copy file="${lib}/log4j/log4j.jar" todir="${dist.download-service.lib}" /> <copy file="${lib}/jetty/jetty.jar" todir="${dist.download-service.lib}" /> <copy file="${lib}/jetty/jetty-util.jar" todir="${dist.download-service.lib}" /> <copy file="${lib}/jetty/servlet-api-2.5.jar" todir="${dist.download-service.lib}" /> <copy file="${lib}/commons-lang/commons-lang.jar" todir="${dist.download-service.lib}" /> <copy file="${lib}/commons-io/commons-io.jar" todir="${dist.download-service.lib}" /> + <copy file="${lib}/commons-logging/commons-logging.jar" todir="${dist.download-service.lib}" /> + <copy file="${lib}/commons-httpclient/commons-httpclient.jar" todir="${dist.download-service.lib}" /> + <copy file="${lib}/commons-codec/commons-codec.jar" todir="${dist.download-service.lib}" /> <property name="dist.file" value="${dist.file.prefix}-${version.number}-r${revision.number}.zip" /> <zip basedir="${dist}" destfile="${dist.file}"> <zipfileset dir="${original.dist}" excludes="**.download-service.sh" prefix="${mainfolder}" /> diff --git a/dataset_download/dist/download-service.sh b/dataset_download/dist/download-service.sh index 676b6e11088..90085e181d3 100755 --- a/dataset_download/dist/download-service.sh +++ b/dataset_download/dist/download-service.sh @@ -48,11 +48,12 @@ isPIDRunning() # PIDFILE=${DOWNLOAD_SERVICE_PID:-DOWNLOAD_SERVICE.pid} -CONFFILE=etc/download-service.conf -LOGFILE=log/download-service_log.txt +CONFFILE=etc/dataset_download.conf +LOGFILE=log/dataset_download_log.txt STARTUPLOG=log/startup_log.txt -SUCCESS_MSG="Data set download service ready" +SUCCESS_MSG="Data set download server ready" MAX_LOOPS=10 +JAR_FILE=lib/download-server.jar # # change to installation directory @@ -76,18 +77,19 @@ else fi command=$1 +ALL_JAVA_OPTS="-Djavax.net.ssl.trustStore=etc/openBIS.keystore $JAVA_OPTS" # ensure that we ignore a possible prefix "--" for any command command="${command#--*}" case "$command" in start) - echo -n "Starting Data Set Download Service " + echo -n "Starting Data Set Download Server " rm -f $LOGFILE.old if [ -f $LOGFILE ]; then mv $LOGFILE $LOGFILE.old fi shift 1 - ${JAVA_BIN} ${JAVA_OPTS} -jar lib/download-service.jar "$@" > $STARTUPLOG 2>&1 & echo $! > $PIDFILE + ${JAVA_BIN} ${ALL_JAVA_OPTS} -jar $JAR_FILE "$@" > $STARTUPLOG 2>&1 & echo $! > $PIDFILE if [ $? -eq 0 ]; then # wait for initial self-test to finish n=0 @@ -119,7 +121,7 @@ case "$command" in fi ;; stop) - echo -n "Stopping Data Set Download Service " + echo -n "Stopping Data Set Download Server " if [ -f $PIDFILE ]; then PID=`cat $PIDFILE` isPIDRunning $PID @@ -144,12 +146,12 @@ case "$command" in PID=`cat $PIDFILE` isPIDRunning $PID if [ $? -eq 0 ]; then - echo "Data Set Download Service is running (pid $PID)" + echo "Data Set Download Server is running (pid $PID)" else - echo "Data Set Download Service is dead (stale pid $PID)" + echo "Data Set Download Server is dead (stale pid $PID)" fi else - echo "Data Set Download Service is not running" + echo "Data Set Download Server is not running" fi ;; restart) @@ -157,10 +159,10 @@ case "$command" in $SCRIPT start ;; help) - ${JAVA_BIN} ${JAVA_OPTS} -jar lib/download-service.jar --help + ${JAVA_BIN} ${ALL_JAVA_OPTS} -jar $JAR_FILE --help ;; version) - ${JAVA_BIN} ${JAVA_OPTS} -jar lib/download-service.jar --version + ${JAVA_BIN} ${ALL_JAVA_OPTS} -jar $JAR_FILE --version ;; *) echo $"Usage: $0 {start|stop|restart|status|help|version}" diff --git a/dataset_download/etc/jetty-keystore b/dataset_download/dist/etc/jetty-keystore similarity index 100% rename from dataset_download/etc/jetty-keystore rename to dataset_download/dist/etc/jetty-keystore diff --git a/dataset_download/dist/etc/log.xml b/dataset_download/dist/etc/log.xml index bb8c5f7ddb2..f6409540fa4 100644 --- a/dataset_download/dist/etc/log.xml +++ b/dataset_download/dist/etc/log.xml @@ -5,7 +5,7 @@ <appender name="DEFAULT" class="org.apache.log4j.DailyRollingFileAppender"> - <param name="File" value="log/etlserver_log.txt"/> + <param name="File" value="log/dataset_download_log.txt"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> diff --git a/dataset_download/dist/etc/openBIS.keystore b/dataset_download/dist/etc/openBIS.keystore new file mode 100644 index 0000000000000000000000000000000000000000..7b07456ab0e7113e47b3a12bd6d899b43aa854e9 GIT binary patch literal 653 zcmezO_TO6u1_mY|W(3o0CHc9@i6ua;(Aot$3Jk0fdZq@JKox!lO-x<}O^lnFSlk@5 zb{O!oacZ@Bw0-AgWMpAwFvu|!FyLcj4rO5zW)IEF&dV>)gNblph_GXbaAAmWV~8-r zMGWM`c@4}BfDSV-Gd46bhyrshfI<*1on6y7A2~D_Ss9ocdl?KGJDD0A8M=$_*XsY^ z+O=#Ot6pwJ<}R+XwOQZ({awRux<Mjpwr-w^MwaisO~rqhJ2}p^t^S&sdD?pC$NgVL zo*ekD9yhV;{|Ci)A{(E*@|&INE1T2#$>gB_m2I`2PK##-D*byUy|cgUpP97&d@qgP z%fH@vaQXR$Kw+!nyCw@AmRBh}xVY=~S0-jg21aD(0V9hU=&tI(G>_{GG}kvK`f5-8 z6|(T!X))1HHq$E)?_C~KB-DK+`g){$wapac%BNoWvX=6?Ujt7Xo%*lcI{!M;-s>?5 z&XeW_JSg4XY_>`9)xo|6(k+S3VJ^ok6qz|1e*FpX{oADSr1aIvTwabX6Q-;@x7cXX p|2!MMpy*?(gv%W-dL{OBv&<CS%EtY=p<7Od=cCD0X11*c8vwZP+!z1= literal 0 HcmV?d00001 diff --git a/dataset_download/dist/etc/service.properties b/dataset_download/dist/etc/service.properties index a7d6634d2a1..af3d58dd294 100644 --- a/dataset_download/dist/etc/service.properties +++ b/dataset_download/dist/etc/service.properties @@ -1,6 +1,9 @@ # The root directory of the data store storeroot-dir = targets/store +# Port +port = <enter port> + # The URL of the openBIS server server-url = http://localhost:8080/openbis @@ -11,10 +14,10 @@ username = <enter user name> password = <enter pass wprd> # Path to the keystore -keystore.path = <enter path> +keystore.path = etc/jetty-keystore # Password of the keystore -keystore.password = <enter password> +keystore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4 # Key password of the keystore -keystore.key-password = <enter key password> +keystore.key-password = OBF:1u2u1wml1z7s1z7a1wnl1u2g \ No newline at end of file diff --git a/dataset_download/dist/log/.gitignore b/dataset_download/dist/log/.gitignore new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dataset_download/etc/service.properties b/dataset_download/etc/service.properties index 2aa0242d442..5177b5b0334 100644 --- a/dataset_download/etc/service.properties +++ b/dataset_download/etc/service.properties @@ -14,7 +14,7 @@ username = data set download server password = doesnotmatter # Path to the keystore -keystore.path = etc/jetty-keystore +keystore.path = dist/etc/jetty-keystore # Password of the keystore keystore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4 diff --git a/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadService.java b/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadService.java index 2935f3deab6..d4eb5c9afec 100644 --- a/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadService.java +++ b/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadService.java @@ -76,7 +76,7 @@ public class DatasetDownloadService selfTest(applicationContext); if (operationLog.isInfoEnabled()) { - operationLog.info("Data set download service ready on port " + port); + operationLog.info("Data set download server ready on port " + port); } } diff --git a/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadServlet.java b/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadServlet.java index b296db6fa30..a50f2e0f73b 100644 --- a/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadServlet.java +++ b/dataset_download/source/java/ch/systemsx/cisd/openbis/datasetdownload/DatasetDownloadServlet.java @@ -126,6 +126,9 @@ public class DatasetDownloadServlet extends HttpServlet { operationLog.error("Request " + request.getRequestURL() + "?" + request.getQueryString() + " caused an exception: ", e); + } else if (operationLog.isInfoEnabled()) + { + operationLog.info("User failure: " + e.getMessage()); } PrintWriter writer = response.getWriter(); writer.println("<html><body><h1>Error</h1>"); -- GitLab