You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fluo.apache.org by kt...@apache.org on 2019/04/17 22:34:35 UTC

[fluo-uno] branch master updated: Made scripts print info about failing commands (#220)

This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/fluo-uno.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c1aadd  Made scripts print info about failing commands (#220)
5c1aadd is described below

commit 5c1aadd983d665b76b3c830f1ab8ae251f508d0c
Author: Keith Turner <kt...@apache.org>
AuthorDate: Wed Apr 17 18:34:31 2019 -0400

    Made scripts print info about failing commands (#220)
---
 bin/impl/install/accumulo.sh  | 1 +
 bin/impl/install/fluo-yarn.sh | 3 +++
 bin/impl/install/fluo.sh      | 3 +++
 bin/impl/install/hadoop.sh    | 1 +
 bin/impl/install/zookeeper.sh | 1 +
 bin/impl/run/accumulo.sh      | 1 +
 bin/impl/run/fluo-yarn.sh     | 1 +
 bin/impl/run/fluo.sh          | 1 +
 bin/impl/run/hadoop.sh        | 1 +
 bin/impl/run/zookeeper.sh     | 1 +
 10 files changed, 14 insertions(+)

diff --git a/bin/impl/install/accumulo.sh b/bin/impl/install/accumulo.sh
index 3fdc011..1140027 100755
--- a/bin/impl/install/accumulo.sh
+++ b/bin/impl/install/accumulo.sh
@@ -21,6 +21,7 @@ pkill -f accumulo.start
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 if [[ -z "$ACCUMULO_REPO" ]]; then
   verify_exist_hash "$ACCUMULO_TARBALL" "$ACCUMULO_HASH"
diff --git a/bin/impl/install/fluo-yarn.sh b/bin/impl/install/fluo-yarn.sh
index aebd17d..bbf7a71 100755
--- a/bin/impl/install/fluo-yarn.sh
+++ b/bin/impl/install/fluo-yarn.sh
@@ -19,6 +19,7 @@ source "$UNO_HOME"/bin/impl/util.sh
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 if [[ -z "$FLUO_YARN_REPO" ]]; then
   verify_exist_hash "$FLUO_YARN_TARBALL" "$FLUO_YARN_HASH"
@@ -32,9 +33,11 @@ fi
 print_to_console "Setting up Apache Fluo YARN launcher at $FLUO_YARN_HOME"
 # Don't stop if pkills fail
 set +e
+trap - ERR
 pkill -f "fluo\.yarn"
 pkill -f twill.launcher
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 rm -rf "$INSTALL"/fluo-yarn*
 
diff --git a/bin/impl/install/fluo.sh b/bin/impl/install/fluo.sh
index 28d5092..49e124e 100755
--- a/bin/impl/install/fluo.sh
+++ b/bin/impl/install/fluo.sh
@@ -19,6 +19,7 @@ source "$UNO_HOME"/bin/impl/util.sh
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 if [[ -z "$FLUO_REPO" ]]; then
   verify_exist_hash "$FLUO_TARBALL" "$FLUO_HASH"
@@ -32,10 +33,12 @@ if [[ -f "$DOWNLOADS/$FLUO_TARBALL" ]]; then
   print_to_console "Setting up Apache Fluo at $FLUO_HOME"
   # Don't stop if pkills fail
   set +e
+  trap - ERR
   pkill -f fluo.yarn
   pkill -f MiniFluo
   pkill -f twill.launcher
   set -e
+  trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
   rm -rf "$INSTALL"/fluo-[0-9]*
 
diff --git a/bin/impl/install/hadoop.sh b/bin/impl/install/hadoop.sh
index 743c83a..8de97f8 100755
--- a/bin/impl/install/hadoop.sh
+++ b/bin/impl/install/hadoop.sh
@@ -22,6 +22,7 @@ pkill -f hadoop.yarn
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 verify_exist_hash "$HADOOP_TARBALL" "$HADOOP_HASH"
 
diff --git a/bin/impl/install/zookeeper.sh b/bin/impl/install/zookeeper.sh
index eb1ba89..9c5e285 100755
--- a/bin/impl/install/zookeeper.sh
+++ b/bin/impl/install/zookeeper.sh
@@ -21,6 +21,7 @@ pkill -f QuorumPeerMain
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 verify_exist_hash "$ZOOKEEPER_TARBALL" "$ZOOKEEPER_HASH"
 
diff --git a/bin/impl/run/accumulo.sh b/bin/impl/run/accumulo.sh
index 30c515a..064a862 100755
--- a/bin/impl/run/accumulo.sh
+++ b/bin/impl/run/accumulo.sh
@@ -21,6 +21,7 @@ pkill -f accumulo.start
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 if [[ $1 != "--no-deps" ]]; then
   run_component hadoop
diff --git a/bin/impl/run/fluo-yarn.sh b/bin/impl/run/fluo-yarn.sh
index 05262e6..759cb89 100755
--- a/bin/impl/run/fluo-yarn.sh
+++ b/bin/impl/run/fluo-yarn.sh
@@ -19,6 +19,7 @@ source "$UNO_HOME"/bin/impl/util.sh
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 if [[ $1 != "--no-deps" ]]; then
   run_component fluo
diff --git a/bin/impl/run/fluo.sh b/bin/impl/run/fluo.sh
index 6dbea2e..e1106b4 100755
--- a/bin/impl/run/fluo.sh
+++ b/bin/impl/run/fluo.sh
@@ -23,6 +23,7 @@ pkill -f twill.launcher
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 if [[ $2 != "--no-deps" ]]; then
   run_component accumulo
diff --git a/bin/impl/run/hadoop.sh b/bin/impl/run/hadoop.sh
index e6a752d..d0791f6 100755
--- a/bin/impl/run/hadoop.sh
+++ b/bin/impl/run/hadoop.sh
@@ -22,6 +22,7 @@ pkill -f hadoop.yarn
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 "$HADOOP_HOME"/bin/hdfs namenode -format
 "$HADOOP_HOME"/sbin/start-dfs.sh
diff --git a/bin/impl/run/zookeeper.sh b/bin/impl/run/zookeeper.sh
index 4a6143e..6c9d607 100755
--- a/bin/impl/run/zookeeper.sh
+++ b/bin/impl/run/zookeeper.sh
@@ -21,6 +21,7 @@ pkill -f QuorumPeerMain
 
 # stop if any command fails
 set -e
+trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAND"' ERR
 
 rm -f "$ZOO_LOG_DIR"/*
 rm -rf "$DATA_DIR"/zookeeper