mikewalch closed pull request #964: Fixes #957 Fluo scripts copy jars into fluo 
software dir.
URL: https://github.com/apache/fluo/pull/964
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/modules/distribution/src/main/config/fluo-env.sh 
b/modules/distribution/src/main/config/fluo-env.sh
index e027f141..0b296655 100755
--- a/modules/distribution/src/main/config/fluo-env.sh
+++ b/modules/distribution/src/main/config/fluo-env.sh
@@ -14,7 +14,7 @@
 ## Before fluo-env.sh is loaded, these environment variables are set and can 
be used in this file:
 
 # cmd - Command that is being called such as oracle, worker, etc.
-# app - Fluo application name 
+# app - Fluo application name
 # basedir - Root of Fluo installation
 # conf - Directory containing Fluo configuration
 # lib - Directory containing Fluo libraries
@@ -27,6 +27,8 @@
 export HADOOP_PREFIX="${HADOOP_PREFIX:-/path/to/hadoop}"
 ## Fluo connection properties
 export FLUO_CONN_PROPS="${FLUO_CONN_PROPS:-${conf}/fluo-conn.properties}"
+## Fluo temp directory where the fluo script will copy jars from HDFS to the 
local machine
+export FLUO_TMP="${FLUO_TMP:-/tmp}"
 
 ####################################################
 # Build JAVA_OPTS variable used by all Fluo commands
diff --git a/modules/distribution/src/main/scripts/fluo 
b/modules/distribution/src/main/scripts/fluo
index abf5576c..4116669f 100755
--- a/modules/distribution/src/main/scripts/fluo
+++ b/modules/distribution/src/main/scripts/fluo
@@ -143,8 +143,10 @@ function setup_service {
     app=${BASH_REMATCH[1]}
     verify_app "$app"
     check_conn_props
-    app_lib=$lib/apps/$1
-    mkdir -p "$app_lib"
+    # create a temp dir to fetch application jars to
+    app_lib=$(mktemp -d "$FLUO_TMP"/fluo-"$app"-XXXXXXXXX) || die "fatal: 
unable to allocate a temporary directory"
+    # schedule removal of app_lib tmp dir when this script exits
+    trap "rm -rf '""$app_lib""'" EXIT HUP INT QUIT TERM
     $JAVA org.apache.fluo.command.FluoGetJars -d "$app_lib" "$@"
     export CLASSPATH="$conf:$app_lib/*:$CLASSPATH"
   else
@@ -225,8 +227,10 @@ exec)
     app=$2
     verify_app "$app"
     check_conn_props
-    app_lib=$lib/apps/$app
-    mkdir -p "$app_lib"
+    # create a temp dir to fetch application jars to
+    app_lib=$(mktemp -d "$FLUO_TMP"/fluo-"$app"-XXXXXXXXX) || die "fatal: 
unable to allocate a temporary directory"
+    # schedule removal of app_lib tmp dir when this script exits
+    trap "rm -rf '""$app_lib""'" EXIT HUP INT QUIT TERM
     $JAVA org.apache.fluo.command.FluoGetJars -d "$app_lib" -a "$app"
     export CLASSPATH="$conf:$app_lib/*:$CLASSPATH"
     $JAVA org.apache.fluo.command.FluoExec "${@:2}"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to