From: <tho...@us...> - 2014-07-17 11:32:02
|
Revision: 8564 http://sourceforge.net/p/bigdata/code/8564 Author: thompsonbry Date: 2014-07-17 11:31:54 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Several changes related to the single-server jetty NSS deployment model (startNSS). build.xml: added comments about the purpose of the different log4j config files. bigdata-war/classes/log4j.properties: modified to NOT specify the FileAppender for the rules log so as to avoid forcing the creation of rules.log file. This tends to be problematic for people since the default directory often does not have sufficient permissions. startNSS: - Modified to fail if BD_HOME is not specified (and reports message). - Wrapped many environment variables in quotes to avoid problems when they are empty. This probably does not handle all edge cases with embedded whitespace yet. - Modified to report the command that is executed and the PID that results. - Modified to not send all output to /dev/null except for brew (the brew code path is probably incorrect, but I have kept the default behavior for now). Note: The bigdataNSS script can not be used to control the run state of the NSS process because it has some brew metavariables. See #918 (Unify the Bigdata Installation Trees) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties branches/BIGDATA_RELEASE_1_3_0/build.xml branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties 2014-07-17 10:52:42 UTC (rev 8563) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/classes/log4j.properties 2014-07-17 11:31:54 UTC (rev 8564) @@ -38,11 +38,14 @@ ## # Rule execution log. This is a formatted log file (comma delimited). +# Uncomment next line and also change from ConsoleAppender to FileAppender. +# Make sure that you can write on the specified file name and directory. #log4j.logger.com.bigdata.relation.rule.eval.RuleLog=INFO,ruleLog log4j.additivity.com.bigdata.relation.rule.eval.RuleLog=false -log4j.appender.ruleLog=org.apache.log4j.FileAppender +log4j.appender.ruleLog=org.apache.log4j.ConsoleAppender +#log4j.appender.ruleLog=org.apache.log4j.FileAppender log4j.appender.ruleLog.Threshold=ALL -log4j.appender.ruleLog.File=rules.log +#log4j.appender.ruleLog.File=rules.log log4j.appender.ruleLog.Append=true # I find that it is nicer to have this unbuffered since you can see what # is going on and to make sure that I have complete rule evaluation logs Modified: branches/BIGDATA_RELEASE_1_3_0/build.xml =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/build.xml 2014-07-17 10:52:42 UTC (rev 8563) +++ branches/BIGDATA_RELEASE_1_3_0/build.xml 2014-07-17 11:31:54 UTC (rev 8564) @@ -1171,6 +1171,7 @@ <property name="logging.to.path" location="${dist.var.config.logging}" /> + <!-- Note: normal server logging files. --> <property name="log4j.from.file" location="${bigdata.dir}/bigdata/src/resources/logging/log4j.properties" /> <copy file="${log4j.from.file}" todir="${logging.to.path}" /> @@ -1179,15 +1180,18 @@ <copy file="${logging.from.file}" todir="${logging.to.path}" /> + <!-- Note: scale-out logging files (standalone mode). --> <property name="standalone.log4j.from.file" location="${src.resources.config}/standalone/log4j.properties" /> <property name="standalone.log4j.to.file" location="${logging.to.path}/log4jStandalone.properties" /> <copy file="${standalone.log4j.from.file}" tofile="${standalone.log4j.to.file}" /> + <!-- Note: scale-out logging files (cluster mode). --> <property name="server.log4j.from.file" location="${src.resources.config}/log4jServer.properties" /> <copy file="${server.log4j.from.file}" todir="${logging.to.path}" /> + <!-- Note: HA replication cluster logging files. --> <property name="haserver.log4j.from.file" location="${src.resources}/HAJournal/log4jHA.properties" /> <copy file="${haserver.log4j.from.file}" todir="${logging.to.path}" /> Modified: branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS 2014-07-17 10:52:42 UTC (rev 8563) +++ branches/BIGDATA_RELEASE_1_3_0/src/resources/deployment/nss/bin/startNSS 2014-07-17 11:31:54 UTC (rev 8564) @@ -1,7 +1,11 @@ #!/bin/bash +if [ -z "${BD_HOME}" ]; then + echo "Not specified: BD_HOME"; + exit 1; +fi export INSTALL_DIR=${BD_HOME} -if [ $INSTALL_TYPE == "BREW" ]; then +if [ "${INSTALL_TYPE}" == "BREW" ]; then export LIB_DIR=${INSTALL_DIR}/libexec else export LIB_DIR=${INSTALL_DIR}/lib @@ -15,13 +19,13 @@ export LOG_DIR=${BD_HOME}/var/log -if [ ! -d $LOG_DIR ]; then - mkdir -p $LOG_DIR +if [ ! -d "${LOG_DIR}" ]; then + mkdir -p "${LOG_DIR}" fi export DATA_DIR=${BD_HOME}/var/data -if [ ! -d $DATA_DIR ]; then - mkdir -p $DATA_DIR +if [ ! -d "${DATA_DIR}" ]; then + mkdir -p "${DATA_DIR}" fi export NSS="com.bigdata.rdf.sail.webapp.NanoSparqlServer" @@ -56,8 +60,8 @@ # Setup the directory for the pid of the ServiceStarter process. lockDir=${INSTALL_DIR}/var/lock -if [ ! -d $lockDir ]; then - mkdir -p $lockDir +if [ ! -d "${lockDir}" ]; then + mkdir -p "${lockDir}" fi pidFile=$lockDir/pid @@ -70,8 +74,19 @@ $NSS_PROPERTIES\ " -# echo "Running: $cmd" -$cmd > /dev/null 2>&1 & +echo "Running: $cmd" +# Note: This redirects console logger output to dev/null! +# This is only valid if all logger output is explicitly +# directed into a file, which it is not when using the +# default log4j and java.util.logging configuration. I am +# leaving the brew installer behavior as its historical +# value to avoid breaking it, but it is very likely to be +# incorrect. +if [ "${INSTALL_TYPE}" == "BREW" ]; then + $cmd > /dev/null 2>&1 & +else + $cmd& +fi pid=$! # echo "PID=$pid" echo "$pid">$pidFile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |