distributedlog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject [1/2] incubator-distributedlog git commit: [maven-release] Fix the script to make sure binary package can execute scripts correctly
Date Mon, 09 Jan 2017 02:41:20 GMT
Repository: incubator-distributedlog
Updated Branches:
  refs/heads/release-0.4.0-incubating 7a0bf9def -> 72ed24c41


[maven-release] Fix the script to make sure binary package can execute scripts correctly


Project: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/commit/09d0fa30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/tree/09d0fa30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/diff/09d0fa30

Branch: refs/heads/release-0.4.0-incubating
Commit: 09d0fa30675f762f976c32bab6e0d9d8ec5f6a98
Parents: 7a0bf9d
Author: Sijie Guo <sijie@apache.org>
Authored: Sun Jan 8 17:54:49 2017 -0800
Committer: Sijie Guo <sijie@apache.org>
Committed: Sun Jan 8 17:54:49 2017 -0800

----------------------------------------------------------------------
 distributedlog-benchmark/bin/common.sh          | 126 +++++++++++++++++++
 distributedlog-benchmark/bin/dbench             |   5 +-
 distributedlog-core/bin/common.sh               | 126 +++++++++++++++++++
 distributedlog-core/bin/dlog                    |   5 +-
 distributedlog-service/bin/common.sh            | 126 +++++++++++++++++++
 distributedlog-service/bin/dlog                 |   5 +-
 .../service/DistributedLogServer.java           |   2 +-
 .../distributedlog-basic/bin/common.sh          | 126 +++++++++++++++++++
 .../distributedlog-basic/bin/runner             |  42 ++++++-
 .../distributedlog-messaging/bin/common.sh      | 126 +++++++++++++++++++
 .../distributedlog-messaging/bin/runner         |  42 ++++++-
 scripts/common.sh                               | 126 -------------------
 scripts/integration/smoketest.sh                |  14 ++-
 scripts/runner                                  |  64 ----------
 14 files changed, 731 insertions(+), 204 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-benchmark/bin/common.sh
----------------------------------------------------------------------
diff --git a/distributedlog-benchmark/bin/common.sh b/distributedlog-benchmark/bin/common.sh
new file mode 100755
index 0000000..0b8278c
--- /dev/null
+++ b/distributedlog-benchmark/bin/common.sh
@@ -0,0 +1,126 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+if [ $(uname) == "Linux" ]; then
+  # check if net.ipv6.bindv6only is set to 1
+  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
+  if [ -n "${bindv6only}" ] && [ "${bindv6only}" -eq "1" ]; then
+    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
+    echo "For more info (the following page also applies to DistributedLog): http://wiki.apache.org/hadoop/HadoopIPv6"
+    exit 1
+  fi
+fi
+
+# See the following page for extensive details on setting
+# up the JVM to accept JMX remote management:
+# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+# by default we allow local JMX connections
+if [ -z "${JMXLOCALONLY}" ]; then
+  JMXLOCALONLY=false
+fi
+
+if [ -z "${JMXDISABLE}" ]; then
+  echo "JMX enabled by default" >&2
+  # for some reason these two options are necessary on jdk6 on Ubuntu
+  # accord to the docs they are not necessary, but otw jconsole cannot
+  # do a local attach
+  JMX_ARGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY}"
+else
+  echo "JMX disabled by user request" >&2
+fi
+
+echo "DLOG_HOME => ${DLOG_HOME}"
+DEFAULT_LOG_CONF="${DLOG_HOME}/conf/log4j.properties"
+
+[ -f "${DLOG_HOME}/conf/dlogenv.sh" ] && source "${DLOG_HOME}/conf/dlogenv.sh"
+
+# exclude tests jar
+RELEASE_JAR=$(ls ${DLOG_HOME}/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+if [ $? == 0 ]; then
+  DLOG_JAR="${RELEASE_JAR}"
+fi
+
+# exclude tests jar
+BUILT_JAR=$(ls ${DLOG_HOME}/target/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+
+if [ -e "${BUILD_JAR}" ] && [ -e "${DLOG_JAR}" ]; then
+  echo "\nCouldn't find dlog jar.";
+  echo "Make sure you've run 'mvn package'\n";
+  exit 1;
+elif [ -e "${BUILT_JAR}" ]; then
+  DLOG_JAR="${BUILT_JAR}"
+fi
+
+add_maven_deps_to_classpath() {
+  MVN="mvn"
+  if [ -n "${MAVEN_HOME}" ]; then
+    MVN="${MAVEN_HOME}/bin/mvn"
+  fi
+
+  # Need to generate classpath from maven pom. This is costly so generate it
+  # and cache it. Save the file into our target dir so a mvn clean will get
+  # clean it up and force us create a new one.
+  f="${PWD}/${DLOG_HOME}/target/cached_classpath.txt"
+  if [ ! -f "${f}" ]; then
+    "${MVN}" -f "${DLOG_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}"
&> /dev/null
+  fi
+  DLOG_CLASSPATH="${CLASSPATH}":$(cat "${f}")
+}
+
+if [ -d "${DLOG_HOME}/lib" ]; then
+  for i in ${DLOG_HOME}/lib/*.jar; do
+    DLOG_CLASSPATH="${DLOG_CLASSPATH}:${i}"
+  done
+else
+  add_maven_deps_to_classpath
+fi
+
+# if no args specified, exit
+if [ $# = 0 ]; then
+  exit 1
+fi
+
+if [ -z "${DLOG_LOG_CONF}" ]; then
+  DLOG_LOG_CONF="${DEFAULT_LOG_CONF}"
+fi
+
+DLOG_CLASSPATH="${DLOG_JAR}:${DLOG_CLASSPATH}:${DLOG_EXTRA_CLASSPATH}"
+if [ -n "${DLOG_LOG_CONF}" ]; then
+  DLOG_CLASSPATH="$(dirname ${DLOG_LOG_CONF}):${DLOG_CLASSPATH}"
+  OPTS="${OPTS} -Dlog4j.configuration=$(basename ${DLOG_LOG_CONF})"
+fi
+OPTS="-cp ${DLOG_CLASSPATH} ${OPTS} ${DLOG_EXTRA_OPTS}"
+
+OPTS="${OPTS} ${DLOG_EXTRA_OPTS}"
+
+# Disable ipv6 as it can cause issues
+OPTS="${OPTS} -Djava.net.preferIPv4Stack=true"
+
+# log directory & file
+DLOG_ROOT_LOGGER=${DLOG_ROOT_LOGGER:-"INFO,R"}
+DLOG_LOG_DIR=${DLOG_LOG_DIR:-"$DLOG_HOME/logs"}
+DLOG_LOG_FILE=${DLOG_LOG_FILE:-"dlog.log"}
+
+#Configure log configuration system properties
+OPTS="$OPTS -Ddlog.root.logger=${DLOG_ROOT_LOGGER}"
+OPTS="$OPTS -Ddlog.log.dir=${DLOG_LOG_DIR}"
+OPTS="$OPTS -Ddlog.log.file=${DLOG_LOG_FILE}"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-benchmark/bin/dbench
----------------------------------------------------------------------
diff --git a/distributedlog-benchmark/bin/dbench b/distributedlog-benchmark/bin/dbench
index afcca62..b2ffd65 100755
--- a/distributedlog-benchmark/bin/dbench
+++ b/distributedlog-benchmark/bin/dbench
@@ -21,9 +21,8 @@
 set -e
 
 BASEDIR=$(dirname "$0")
-DLOG_ROOT="${BASEDIR}/../.."
 
-DLOG_HOME="${DLOG_ROOT}/distributedlog-benchmark"
+DLOG_HOME="${BASEDIR}/.."
 
 usage() {
     cat <<EOF
@@ -44,7 +43,7 @@ These variable can also be set in conf/dlogenv.sh
 EOF
 }
 
-source ${DLOG_ROOT}/scripts/common.sh
+source ${DLOG_HOME}/bin/common.sh
 
 # get arguments
 COMMAND=$1

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-core/bin/common.sh
----------------------------------------------------------------------
diff --git a/distributedlog-core/bin/common.sh b/distributedlog-core/bin/common.sh
new file mode 100755
index 0000000..0b8278c
--- /dev/null
+++ b/distributedlog-core/bin/common.sh
@@ -0,0 +1,126 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+if [ $(uname) == "Linux" ]; then
+  # check if net.ipv6.bindv6only is set to 1
+  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
+  if [ -n "${bindv6only}" ] && [ "${bindv6only}" -eq "1" ]; then
+    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
+    echo "For more info (the following page also applies to DistributedLog): http://wiki.apache.org/hadoop/HadoopIPv6"
+    exit 1
+  fi
+fi
+
+# See the following page for extensive details on setting
+# up the JVM to accept JMX remote management:
+# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+# by default we allow local JMX connections
+if [ -z "${JMXLOCALONLY}" ]; then
+  JMXLOCALONLY=false
+fi
+
+if [ -z "${JMXDISABLE}" ]; then
+  echo "JMX enabled by default" >&2
+  # for some reason these two options are necessary on jdk6 on Ubuntu
+  # accord to the docs they are not necessary, but otw jconsole cannot
+  # do a local attach
+  JMX_ARGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY}"
+else
+  echo "JMX disabled by user request" >&2
+fi
+
+echo "DLOG_HOME => ${DLOG_HOME}"
+DEFAULT_LOG_CONF="${DLOG_HOME}/conf/log4j.properties"
+
+[ -f "${DLOG_HOME}/conf/dlogenv.sh" ] && source "${DLOG_HOME}/conf/dlogenv.sh"
+
+# exclude tests jar
+RELEASE_JAR=$(ls ${DLOG_HOME}/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+if [ $? == 0 ]; then
+  DLOG_JAR="${RELEASE_JAR}"
+fi
+
+# exclude tests jar
+BUILT_JAR=$(ls ${DLOG_HOME}/target/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+
+if [ -e "${BUILD_JAR}" ] && [ -e "${DLOG_JAR}" ]; then
+  echo "\nCouldn't find dlog jar.";
+  echo "Make sure you've run 'mvn package'\n";
+  exit 1;
+elif [ -e "${BUILT_JAR}" ]; then
+  DLOG_JAR="${BUILT_JAR}"
+fi
+
+add_maven_deps_to_classpath() {
+  MVN="mvn"
+  if [ -n "${MAVEN_HOME}" ]; then
+    MVN="${MAVEN_HOME}/bin/mvn"
+  fi
+
+  # Need to generate classpath from maven pom. This is costly so generate it
+  # and cache it. Save the file into our target dir so a mvn clean will get
+  # clean it up and force us create a new one.
+  f="${PWD}/${DLOG_HOME}/target/cached_classpath.txt"
+  if [ ! -f "${f}" ]; then
+    "${MVN}" -f "${DLOG_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}"
&> /dev/null
+  fi
+  DLOG_CLASSPATH="${CLASSPATH}":$(cat "${f}")
+}
+
+if [ -d "${DLOG_HOME}/lib" ]; then
+  for i in ${DLOG_HOME}/lib/*.jar; do
+    DLOG_CLASSPATH="${DLOG_CLASSPATH}:${i}"
+  done
+else
+  add_maven_deps_to_classpath
+fi
+
+# if no args specified, exit
+if [ $# = 0 ]; then
+  exit 1
+fi
+
+if [ -z "${DLOG_LOG_CONF}" ]; then
+  DLOG_LOG_CONF="${DEFAULT_LOG_CONF}"
+fi
+
+DLOG_CLASSPATH="${DLOG_JAR}:${DLOG_CLASSPATH}:${DLOG_EXTRA_CLASSPATH}"
+if [ -n "${DLOG_LOG_CONF}" ]; then
+  DLOG_CLASSPATH="$(dirname ${DLOG_LOG_CONF}):${DLOG_CLASSPATH}"
+  OPTS="${OPTS} -Dlog4j.configuration=$(basename ${DLOG_LOG_CONF})"
+fi
+OPTS="-cp ${DLOG_CLASSPATH} ${OPTS} ${DLOG_EXTRA_OPTS}"
+
+OPTS="${OPTS} ${DLOG_EXTRA_OPTS}"
+
+# Disable ipv6 as it can cause issues
+OPTS="${OPTS} -Djava.net.preferIPv4Stack=true"
+
+# log directory & file
+DLOG_ROOT_LOGGER=${DLOG_ROOT_LOGGER:-"INFO,R"}
+DLOG_LOG_DIR=${DLOG_LOG_DIR:-"$DLOG_HOME/logs"}
+DLOG_LOG_FILE=${DLOG_LOG_FILE:-"dlog.log"}
+
+#Configure log configuration system properties
+OPTS="$OPTS -Ddlog.root.logger=${DLOG_ROOT_LOGGER}"
+OPTS="$OPTS -Ddlog.log.dir=${DLOG_LOG_DIR}"
+OPTS="$OPTS -Ddlog.log.file=${DLOG_LOG_FILE}"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-core/bin/dlog
----------------------------------------------------------------------
diff --git a/distributedlog-core/bin/dlog b/distributedlog-core/bin/dlog
index bf48148..6a93eb3 100755
--- a/distributedlog-core/bin/dlog
+++ b/distributedlog-core/bin/dlog
@@ -21,9 +21,8 @@
 set -e
 
 BASEDIR=$(dirname "$0")
-DLOG_ROOT="${BASEDIR}/../.."
 
-DLOG_HOME="${DLOG_ROOT}/distributedlog-core"
+DLOG_HOME="${BASEDIR}/.."
 
 usage() {
   cat <<EOF
@@ -48,7 +47,7 @@ These variable can also be set in conf/dlogenv.sh
 EOF
 }
 
-source "${DLOG_ROOT}"/scripts/common.sh
+source "${DLOG_HOME}"/bin/common.sh
 
 # get arguments
 COMMAND=$1

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-service/bin/common.sh
----------------------------------------------------------------------
diff --git a/distributedlog-service/bin/common.sh b/distributedlog-service/bin/common.sh
new file mode 100755
index 0000000..0b8278c
--- /dev/null
+++ b/distributedlog-service/bin/common.sh
@@ -0,0 +1,126 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+if [ $(uname) == "Linux" ]; then
+  # check if net.ipv6.bindv6only is set to 1
+  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
+  if [ -n "${bindv6only}" ] && [ "${bindv6only}" -eq "1" ]; then
+    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
+    echo "For more info (the following page also applies to DistributedLog): http://wiki.apache.org/hadoop/HadoopIPv6"
+    exit 1
+  fi
+fi
+
+# See the following page for extensive details on setting
+# up the JVM to accept JMX remote management:
+# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+# by default we allow local JMX connections
+if [ -z "${JMXLOCALONLY}" ]; then
+  JMXLOCALONLY=false
+fi
+
+if [ -z "${JMXDISABLE}" ]; then
+  echo "JMX enabled by default" >&2
+  # for some reason these two options are necessary on jdk6 on Ubuntu
+  # accord to the docs they are not necessary, but otw jconsole cannot
+  # do a local attach
+  JMX_ARGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY}"
+else
+  echo "JMX disabled by user request" >&2
+fi
+
+echo "DLOG_HOME => ${DLOG_HOME}"
+DEFAULT_LOG_CONF="${DLOG_HOME}/conf/log4j.properties"
+
+[ -f "${DLOG_HOME}/conf/dlogenv.sh" ] && source "${DLOG_HOME}/conf/dlogenv.sh"
+
+# exclude tests jar
+RELEASE_JAR=$(ls ${DLOG_HOME}/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+if [ $? == 0 ]; then
+  DLOG_JAR="${RELEASE_JAR}"
+fi
+
+# exclude tests jar
+BUILT_JAR=$(ls ${DLOG_HOME}/target/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+
+if [ -e "${BUILD_JAR}" ] && [ -e "${DLOG_JAR}" ]; then
+  echo "\nCouldn't find dlog jar.";
+  echo "Make sure you've run 'mvn package'\n";
+  exit 1;
+elif [ -e "${BUILT_JAR}" ]; then
+  DLOG_JAR="${BUILT_JAR}"
+fi
+
+add_maven_deps_to_classpath() {
+  MVN="mvn"
+  if [ -n "${MAVEN_HOME}" ]; then
+    MVN="${MAVEN_HOME}/bin/mvn"
+  fi
+
+  # Need to generate classpath from maven pom. This is costly so generate it
+  # and cache it. Save the file into our target dir so a mvn clean will get
+  # clean it up and force us create a new one.
+  f="${PWD}/${DLOG_HOME}/target/cached_classpath.txt"
+  if [ ! -f "${f}" ]; then
+    "${MVN}" -f "${DLOG_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}"
&> /dev/null
+  fi
+  DLOG_CLASSPATH="${CLASSPATH}":$(cat "${f}")
+}
+
+if [ -d "${DLOG_HOME}/lib" ]; then
+  for i in ${DLOG_HOME}/lib/*.jar; do
+    DLOG_CLASSPATH="${DLOG_CLASSPATH}:${i}"
+  done
+else
+  add_maven_deps_to_classpath
+fi
+
+# if no args specified, exit
+if [ $# = 0 ]; then
+  exit 1
+fi
+
+if [ -z "${DLOG_LOG_CONF}" ]; then
+  DLOG_LOG_CONF="${DEFAULT_LOG_CONF}"
+fi
+
+DLOG_CLASSPATH="${DLOG_JAR}:${DLOG_CLASSPATH}:${DLOG_EXTRA_CLASSPATH}"
+if [ -n "${DLOG_LOG_CONF}" ]; then
+  DLOG_CLASSPATH="$(dirname ${DLOG_LOG_CONF}):${DLOG_CLASSPATH}"
+  OPTS="${OPTS} -Dlog4j.configuration=$(basename ${DLOG_LOG_CONF})"
+fi
+OPTS="-cp ${DLOG_CLASSPATH} ${OPTS} ${DLOG_EXTRA_OPTS}"
+
+OPTS="${OPTS} ${DLOG_EXTRA_OPTS}"
+
+# Disable ipv6 as it can cause issues
+OPTS="${OPTS} -Djava.net.preferIPv4Stack=true"
+
+# log directory & file
+DLOG_ROOT_LOGGER=${DLOG_ROOT_LOGGER:-"INFO,R"}
+DLOG_LOG_DIR=${DLOG_LOG_DIR:-"$DLOG_HOME/logs"}
+DLOG_LOG_FILE=${DLOG_LOG_FILE:-"dlog.log"}
+
+#Configure log configuration system properties
+OPTS="$OPTS -Ddlog.root.logger=${DLOG_ROOT_LOGGER}"
+OPTS="$OPTS -Ddlog.log.dir=${DLOG_LOG_DIR}"
+OPTS="$OPTS -Ddlog.log.file=${DLOG_LOG_FILE}"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-service/bin/dlog
----------------------------------------------------------------------
diff --git a/distributedlog-service/bin/dlog b/distributedlog-service/bin/dlog
index 30e8d38..99cad40 100755
--- a/distributedlog-service/bin/dlog
+++ b/distributedlog-service/bin/dlog
@@ -21,8 +21,7 @@
 set -e
 
 BASEDIR=$(dirname "$0")
-DLOG_ROOT="${BASEDIR}/.."
-DLOG_HOME="${DLOG_ROOT}"
+DLOG_HOME="${BASEDIR}/.."
 
 usage() {
   cat <<EOF
@@ -49,7 +48,7 @@ These variable can also be set in conf/dlogenv.sh
 EOF
 }
 
-source "${DLOG_ROOT}"/../scripts/common.sh
+source "${DLOG_HOME}"/bin/common.sh
 
 # get arguments
 COMMAND=$1

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-service/src/main/java/org/apache/distributedlog/service/DistributedLogServer.java
----------------------------------------------------------------------
diff --git a/distributedlog-service/src/main/java/org/apache/distributedlog/service/DistributedLogServer.java
b/distributedlog-service/src/main/java/org/apache/distributedlog/service/DistributedLogServer.java
index 7887445..d37612a 100644
--- a/distributedlog-service/src/main/java/org/apache/distributedlog/service/DistributedLogServer.java
+++ b/distributedlog-service/src/main/java/org/apache/distributedlog/service/DistributedLogServer.java
@@ -186,7 +186,7 @@ public class DistributedLogServer {
         }
         Class loadAppraiserClass = Class.forName(loadAppraiserClassStr.or(DEFAULT_LOAD_APPRIASER));
         LoadAppraiser loadAppraiser = (LoadAppraiser) ReflectionUtils.newInstance(loadAppraiserClass);
-        logger.info("Supplied load appraiser class is " + loadAppraiserClassStr.get()
+        logger.info("Supplied load appraiser class is " + loadAppraiserClass
             + " Instantiated " + loadAppraiser.getClass().getCanonicalName());
 
         StreamConfigProvider streamConfProvider =

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-tutorials/distributedlog-basic/bin/common.sh
----------------------------------------------------------------------
diff --git a/distributedlog-tutorials/distributedlog-basic/bin/common.sh b/distributedlog-tutorials/distributedlog-basic/bin/common.sh
new file mode 100755
index 0000000..0b8278c
--- /dev/null
+++ b/distributedlog-tutorials/distributedlog-basic/bin/common.sh
@@ -0,0 +1,126 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+if [ $(uname) == "Linux" ]; then
+  # check if net.ipv6.bindv6only is set to 1
+  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
+  if [ -n "${bindv6only}" ] && [ "${bindv6only}" -eq "1" ]; then
+    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
+    echo "For more info (the following page also applies to DistributedLog): http://wiki.apache.org/hadoop/HadoopIPv6"
+    exit 1
+  fi
+fi
+
+# See the following page for extensive details on setting
+# up the JVM to accept JMX remote management:
+# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+# by default we allow local JMX connections
+if [ -z "${JMXLOCALONLY}" ]; then
+  JMXLOCALONLY=false
+fi
+
+if [ -z "${JMXDISABLE}" ]; then
+  echo "JMX enabled by default" >&2
+  # for some reason these two options are necessary on jdk6 on Ubuntu
+  # accord to the docs they are not necessary, but otw jconsole cannot
+  # do a local attach
+  JMX_ARGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY}"
+else
+  echo "JMX disabled by user request" >&2
+fi
+
+echo "DLOG_HOME => ${DLOG_HOME}"
+DEFAULT_LOG_CONF="${DLOG_HOME}/conf/log4j.properties"
+
+[ -f "${DLOG_HOME}/conf/dlogenv.sh" ] && source "${DLOG_HOME}/conf/dlogenv.sh"
+
+# exclude tests jar
+RELEASE_JAR=$(ls ${DLOG_HOME}/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+if [ $? == 0 ]; then
+  DLOG_JAR="${RELEASE_JAR}"
+fi
+
+# exclude tests jar
+BUILT_JAR=$(ls ${DLOG_HOME}/target/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+
+if [ -e "${BUILD_JAR}" ] && [ -e "${DLOG_JAR}" ]; then
+  echo "\nCouldn't find dlog jar.";
+  echo "Make sure you've run 'mvn package'\n";
+  exit 1;
+elif [ -e "${BUILT_JAR}" ]; then
+  DLOG_JAR="${BUILT_JAR}"
+fi
+
+add_maven_deps_to_classpath() {
+  MVN="mvn"
+  if [ -n "${MAVEN_HOME}" ]; then
+    MVN="${MAVEN_HOME}/bin/mvn"
+  fi
+
+  # Need to generate classpath from maven pom. This is costly so generate it
+  # and cache it. Save the file into our target dir so a mvn clean will get
+  # clean it up and force us create a new one.
+  f="${PWD}/${DLOG_HOME}/target/cached_classpath.txt"
+  if [ ! -f "${f}" ]; then
+    "${MVN}" -f "${DLOG_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}"
&> /dev/null
+  fi
+  DLOG_CLASSPATH="${CLASSPATH}":$(cat "${f}")
+}
+
+if [ -d "${DLOG_HOME}/lib" ]; then
+  for i in ${DLOG_HOME}/lib/*.jar; do
+    DLOG_CLASSPATH="${DLOG_CLASSPATH}:${i}"
+  done
+else
+  add_maven_deps_to_classpath
+fi
+
+# if no args specified, exit
+if [ $# = 0 ]; then
+  exit 1
+fi
+
+if [ -z "${DLOG_LOG_CONF}" ]; then
+  DLOG_LOG_CONF="${DEFAULT_LOG_CONF}"
+fi
+
+DLOG_CLASSPATH="${DLOG_JAR}:${DLOG_CLASSPATH}:${DLOG_EXTRA_CLASSPATH}"
+if [ -n "${DLOG_LOG_CONF}" ]; then
+  DLOG_CLASSPATH="$(dirname ${DLOG_LOG_CONF}):${DLOG_CLASSPATH}"
+  OPTS="${OPTS} -Dlog4j.configuration=$(basename ${DLOG_LOG_CONF})"
+fi
+OPTS="-cp ${DLOG_CLASSPATH} ${OPTS} ${DLOG_EXTRA_OPTS}"
+
+OPTS="${OPTS} ${DLOG_EXTRA_OPTS}"
+
+# Disable ipv6 as it can cause issues
+OPTS="${OPTS} -Djava.net.preferIPv4Stack=true"
+
+# log directory & file
+DLOG_ROOT_LOGGER=${DLOG_ROOT_LOGGER:-"INFO,R"}
+DLOG_LOG_DIR=${DLOG_LOG_DIR:-"$DLOG_HOME/logs"}
+DLOG_LOG_FILE=${DLOG_LOG_FILE:-"dlog.log"}
+
+#Configure log configuration system properties
+OPTS="$OPTS -Ddlog.root.logger=${DLOG_ROOT_LOGGER}"
+OPTS="$OPTS -Ddlog.log.dir=${DLOG_LOG_DIR}"
+OPTS="$OPTS -Ddlog.log.file=${DLOG_LOG_FILE}"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-tutorials/distributedlog-basic/bin/runner
----------------------------------------------------------------------
diff --git a/distributedlog-tutorials/distributedlog-basic/bin/runner b/distributedlog-tutorials/distributedlog-basic/bin/runner
deleted file mode 120000
index 7a0fefc..0000000
--- a/distributedlog-tutorials/distributedlog-basic/bin/runner
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-#
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-../../../scripts/runner
diff --git a/distributedlog-tutorials/distributedlog-basic/bin/runner b/distributedlog-tutorials/distributedlog-basic/bin/runner
new file mode 100755
index 0000000..be23e00
--- /dev/null
+++ b/distributedlog-tutorials/distributedlog-basic/bin/runner
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+set -e
+
+BASEDIR=$(dirname "$0")
+DLOG_HOME="${BASEDIR}/.."
+
+usage() {
+  cat <<EOF
+Usage: runner <command>
+where command is one of:
+  run                 Run distributedlog example
+  help                This help message
+
+or command is the full name of a class with a defined main() method.
+
+Environment variables:
+  DLOG_LOG_CONF        Log4j configuration file (default $DEFAULT_LOG_CONF)
+  DLOG_EXTRA_OPTS      Extra options to be passed to the jvm
+  DLOG_EXTRA_CLASSPATH Add extra paths to the dlog classpath
+
+These variable can also be set in conf/dlogenv.sh
+EOF
+}
+
+source "${DLOG_HOME}/bin/common.sh"
+
+# get arguments
+COMMAND="${1}"
+shift
+
+case "${COMMAND}" in
+  run)
+    java ${OPTS} $@
+    ;;
+  help)
+    usage
+    ;;
+  *)
+    usage
+    exit 1
+    ;;
+esac

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-tutorials/distributedlog-messaging/bin/common.sh
----------------------------------------------------------------------
diff --git a/distributedlog-tutorials/distributedlog-messaging/bin/common.sh b/distributedlog-tutorials/distributedlog-messaging/bin/common.sh
new file mode 100755
index 0000000..0b8278c
--- /dev/null
+++ b/distributedlog-tutorials/distributedlog-messaging/bin/common.sh
@@ -0,0 +1,126 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+if [ $(uname) == "Linux" ]; then
+  # check if net.ipv6.bindv6only is set to 1
+  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
+  if [ -n "${bindv6only}" ] && [ "${bindv6only}" -eq "1" ]; then
+    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
+    echo "For more info (the following page also applies to DistributedLog): http://wiki.apache.org/hadoop/HadoopIPv6"
+    exit 1
+  fi
+fi
+
+# See the following page for extensive details on setting
+# up the JVM to accept JMX remote management:
+# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+# by default we allow local JMX connections
+if [ -z "${JMXLOCALONLY}" ]; then
+  JMXLOCALONLY=false
+fi
+
+if [ -z "${JMXDISABLE}" ]; then
+  echo "JMX enabled by default" >&2
+  # for some reason these two options are necessary on jdk6 on Ubuntu
+  # accord to the docs they are not necessary, but otw jconsole cannot
+  # do a local attach
+  JMX_ARGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY}"
+else
+  echo "JMX disabled by user request" >&2
+fi
+
+echo "DLOG_HOME => ${DLOG_HOME}"
+DEFAULT_LOG_CONF="${DLOG_HOME}/conf/log4j.properties"
+
+[ -f "${DLOG_HOME}/conf/dlogenv.sh" ] && source "${DLOG_HOME}/conf/dlogenv.sh"
+
+# exclude tests jar
+RELEASE_JAR=$(ls ${DLOG_HOME}/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+if [ $? == 0 ]; then
+  DLOG_JAR="${RELEASE_JAR}"
+fi
+
+# exclude tests jar
+BUILT_JAR=$(ls ${DLOG_HOME}/target/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
+
+if [ -e "${BUILD_JAR}" ] && [ -e "${DLOG_JAR}" ]; then
+  echo "\nCouldn't find dlog jar.";
+  echo "Make sure you've run 'mvn package'\n";
+  exit 1;
+elif [ -e "${BUILT_JAR}" ]; then
+  DLOG_JAR="${BUILT_JAR}"
+fi
+
+add_maven_deps_to_classpath() {
+  MVN="mvn"
+  if [ -n "${MAVEN_HOME}" ]; then
+    MVN="${MAVEN_HOME}/bin/mvn"
+  fi
+
+  # Need to generate classpath from maven pom. This is costly so generate it
+  # and cache it. Save the file into our target dir so a mvn clean will get
+  # clean it up and force us create a new one.
+  f="${PWD}/${DLOG_HOME}/target/cached_classpath.txt"
+  if [ ! -f "${f}" ]; then
+    "${MVN}" -f "${DLOG_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}"
&> /dev/null
+  fi
+  DLOG_CLASSPATH="${CLASSPATH}":$(cat "${f}")
+}
+
+if [ -d "${DLOG_HOME}/lib" ]; then
+  for i in ${DLOG_HOME}/lib/*.jar; do
+    DLOG_CLASSPATH="${DLOG_CLASSPATH}:${i}"
+  done
+else
+  add_maven_deps_to_classpath
+fi
+
+# if no args specified, exit
+if [ $# = 0 ]; then
+  exit 1
+fi
+
+if [ -z "${DLOG_LOG_CONF}" ]; then
+  DLOG_LOG_CONF="${DEFAULT_LOG_CONF}"
+fi
+
+DLOG_CLASSPATH="${DLOG_JAR}:${DLOG_CLASSPATH}:${DLOG_EXTRA_CLASSPATH}"
+if [ -n "${DLOG_LOG_CONF}" ]; then
+  DLOG_CLASSPATH="$(dirname ${DLOG_LOG_CONF}):${DLOG_CLASSPATH}"
+  OPTS="${OPTS} -Dlog4j.configuration=$(basename ${DLOG_LOG_CONF})"
+fi
+OPTS="-cp ${DLOG_CLASSPATH} ${OPTS} ${DLOG_EXTRA_OPTS}"
+
+OPTS="${OPTS} ${DLOG_EXTRA_OPTS}"
+
+# Disable ipv6 as it can cause issues
+OPTS="${OPTS} -Djava.net.preferIPv4Stack=true"
+
+# log directory & file
+DLOG_ROOT_LOGGER=${DLOG_ROOT_LOGGER:-"INFO,R"}
+DLOG_LOG_DIR=${DLOG_LOG_DIR:-"$DLOG_HOME/logs"}
+DLOG_LOG_FILE=${DLOG_LOG_FILE:-"dlog.log"}
+
+#Configure log configuration system properties
+OPTS="$OPTS -Ddlog.root.logger=${DLOG_ROOT_LOGGER}"
+OPTS="$OPTS -Ddlog.log.dir=${DLOG_LOG_DIR}"
+OPTS="$OPTS -Ddlog.log.file=${DLOG_LOG_FILE}"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/distributedlog-tutorials/distributedlog-messaging/bin/runner
----------------------------------------------------------------------
diff --git a/distributedlog-tutorials/distributedlog-messaging/bin/runner b/distributedlog-tutorials/distributedlog-messaging/bin/runner
deleted file mode 120000
index 7a0fefc..0000000
--- a/distributedlog-tutorials/distributedlog-messaging/bin/runner
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-#
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-../../../scripts/runner
diff --git a/distributedlog-tutorials/distributedlog-messaging/bin/runner b/distributedlog-tutorials/distributedlog-messaging/bin/runner
new file mode 100755
index 0000000..be23e00
--- /dev/null
+++ b/distributedlog-tutorials/distributedlog-messaging/bin/runner
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+set -e
+
+BASEDIR=$(dirname "$0")
+DLOG_HOME="${BASEDIR}/.."
+
+usage() {
+  cat <<EOF
+Usage: runner <command>
+where command is one of:
+  run                 Run distributedlog example
+  help                This help message
+
+or command is the full name of a class with a defined main() method.
+
+Environment variables:
+  DLOG_LOG_CONF        Log4j configuration file (default $DEFAULT_LOG_CONF)
+  DLOG_EXTRA_OPTS      Extra options to be passed to the jvm
+  DLOG_EXTRA_CLASSPATH Add extra paths to the dlog classpath
+
+These variable can also be set in conf/dlogenv.sh
+EOF
+}
+
+source "${DLOG_HOME}/bin/common.sh"
+
+# get arguments
+COMMAND="${1}"
+shift
+
+case "${COMMAND}" in
+  run)
+    java ${OPTS} $@
+    ;;
+  help)
+    usage
+    ;;
+  *)
+    usage
+    exit 1
+    ;;
+esac

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/scripts/common.sh
----------------------------------------------------------------------
diff --git a/scripts/common.sh b/scripts/common.sh
deleted file mode 100755
index 8df5248..0000000
--- a/scripts/common.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env bash
-#
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-if [ $(uname) == "Linux" ]; then
-  # check if net.ipv6.bindv6only is set to 1
-  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
-  if [ -n "${bindv6only}" ] && [ "${bindv6only}" -eq "1" ]; then
-    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
-    echo "For more info (the following page also applies to DistributedLog): http://wiki.apache.org/hadoop/HadoopIPv6"
-    exit 1
-  fi
-fi
-
-# See the following page for extensive details on setting
-# up the JVM to accept JMX remote management:
-# http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
-# by default we allow local JMX connections
-if [ -z "${JMXLOCALONLY}" ]; then
-  JMXLOCALONLY=false
-fi
-
-if [ -z "${JMXDISABLE}" ]; then
-  echo "JMX enabled by default" >&2
-  # for some reason these two options are necessary on jdk6 on Ubuntu
-  # accord to the docs they are not necessary, but otw jconsole cannot
-  # do a local attach
-  JMX_ARGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY}"
-else
-  echo "JMX disabled by user request" >&2
-fi
-
-echo "DLOG_HOME => ${DLOG_HOME}"
-DEFAULT_LOG_CONF="${DLOG_HOME}/conf/log4j.properties"
-
-[ -f "${DLOG_HOME}/conf/dlogenv.sh" ] && source "${DLOG_HOME}/conf/dlogenv.sh"
-
-# exclude tests jar
-RELEASE_JAR=$(ls "${DLOG_HOME}/distributedlog-*.jar" 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
-if [ $? == 0 ]; then
-  DLOG_JAR="${RELEASE_JAR}"
-fi
-
-# exclude tests jar
-BUILT_JAR=$(ls "${DLOG_HOME}"/target/distributedlog-*.jar 2> /dev/null | grep -v 'tests|javadoc|sources'
| tail -1)
-
-if [ -e "${BUILD_JAR}" ] && [ -e "${DLOG_JAR}" ]; then
-  echo "\nCouldn't find dlog jar.";
-  echo "Make sure you've run 'mvn package'\n";
-  exit 1;
-elif [ -e "${BUILT_JAR}" ]; then
-  DLOG_JAR="${BUILT_JAR}"
-fi
-
-add_maven_deps_to_classpath() {
-  MVN="mvn"
-  if [ -n "${MAVEN_HOME}" ]; then
-    MVN="${MAVEN_HOME}/bin/mvn"
-  fi
-
-  # Need to generate classpath from maven pom. This is costly so generate it
-  # and cache it. Save the file into our target dir so a mvn clean will get
-  # clean it up and force us create a new one.
-  f="${PWD}/${DLOG_HOME}/target/cached_classpath.txt"
-  if [ ! -f "${f}" ]; then
-    "${MVN}" -f "${DLOG_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}"
&> /dev/null
-  fi
-  DLOG_CLASSPATH="${CLASSPATH}":$(cat "${f}")
-}
-
-if [ -d "${DLOG_HOME}/lib" ]; then
-  for i in ${DLOG_HOME}/lib/*.jar; do
-    DLOG_CLASSPATH="${DLOG_CLASSPATH}:${i}"
-  done
-else
-  add_maven_deps_to_classpath
-fi
-
-# if no args specified, exit
-if [ $# = 0 ]; then
-  exit 1
-fi
-
-if [ -z "${DLOG_LOG_CONF}" ]; then
-  DLOG_LOG_CONF="${DEFAULT_LOG_CONF}"
-fi
-
-DLOG_CLASSPATH="${DLOG_JAR}:${DLOG_CLASSPATH}:${DLOG_EXTRA_CLASSPATH}"
-if [ -n "${DLOG_LOG_CONF}" ]; then
-  DLOG_CLASSPATH="$(dirname ${DLOG_LOG_CONF}):${DLOG_CLASSPATH}"
-  OPTS="${OPTS} -Dlog4j.configuration=$(basename ${DLOG_LOG_CONF})"
-fi
-OPTS="-cp ${DLOG_CLASSPATH} ${OPTS} ${DLOG_EXTRA_OPTS}"
-
-OPTS="${OPTS} ${DLOG_EXTRA_OPTS}"
-
-# Disable ipv6 as it can cause issues
-OPTS="${OPTS} -Djava.net.preferIPv4Stack=true"
-
-# log directory & file
-DLOG_ROOT_LOGGER=${DLOG_ROOT_LOGGER:-"INFO,R"}
-DLOG_LOG_DIR=${DLOG_LOG_DIR:-"$DLOG_HOME/logs"}
-DLOG_LOG_FILE=${DLOG_LOG_FILE:-"dlog.log"}
-
-#Configure log configuration system properties
-OPTS="$OPTS -Ddlog.root.logger=${DLOG_ROOT_LOGGER}"
-OPTS="$OPTS -Ddlog.log.dir=${DLOG_LOG_DIR}"
-OPTS="$OPTS -Ddlog.log.file=${DLOG_LOG_FILE}"

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/scripts/integration/smoketest.sh
----------------------------------------------------------------------
diff --git a/scripts/integration/smoketest.sh b/scripts/integration/smoketest.sh
index 991dc6b..0de830d 100755
--- a/scripts/integration/smoketest.sh
+++ b/scripts/integration/smoketest.sh
@@ -88,10 +88,20 @@ echo $! > ${LOG_DIR}/writer.pid
 sleep 20
 
 # kill the writer
-kill `cat ${LOG_DIR}/writer.pid`
+if [ -f ${LOG_DIR}/writer.pid ]; then
+  writerpid=$(cat ${LOG_DIR}/writer.pid) 
+  if kill -0 $writerpid > /dev/null 2>&1; then
+    kill $writerpid
+  fi
+fi
 
 # stop the reader
-kill `cat ${LOG_DIR}/reader.pid`
+if [ -f ${LOG_DIR}/reader.pid ]; then
+  readerpid=$(cat ${LOG_DIR}/reader.pid) 
+  if kill -0 $readerpid > /dev/null 2>&1; then
+    kill $readerpid
+  fi
+fi
 
 # check the number of records received
 NUM_RECORDS=`cat ${LOG_DIR}/reader.out | grep "record-" | wc -l`

http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/09d0fa30/scripts/runner
----------------------------------------------------------------------
diff --git a/scripts/runner b/scripts/runner
deleted file mode 100755
index 78ce126..0000000
--- a/scripts/runner
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env bash
-#
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-set -e
-
-BASEDIR=$(dirname "$0")
-DLOG_ROOT="${BASEDIR}/../../.."
-DLOG_HOME="${BASEDIR}/.."
-
-usage() {
-  cat <<EOF
-Usage: runner <command>
-where command is one of:
-  run                 Run distributedlog example
-  help                This help message
-
-or command is the full name of a class with a defined main() method.
-
-Environment variables:
-  DLOG_LOG_CONF        Log4j configuration file (default $DEFAULT_LOG_CONF)
-  DLOG_EXTRA_OPTS      Extra options to be passed to the jvm
-  DLOG_EXTRA_CLASSPATH Add extra paths to the dlog classpath
-
-These variable can also be set in conf/dlogenv.sh
-EOF
-}
-
-source "${DLOG_ROOT}/scripts/common.sh"
-
-# get arguments
-COMMAND="${1}"
-shift
-
-case "${COMMAND}" in
-  run)
-    java ${OPTS} $@
-    ;;
-  help)
-    usage
-    ;;
-  *)
-    usage
-    exit 1
-    ;;
-esac



Mime
View raw message