aboutsummaryrefslogtreecommitdiff
path: root/sbin/stop-master.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/stop-master.sh')
-rwxr-xr-xsbin/stop-master.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/sbin/stop-master.sh b/sbin/stop-master.sh
index 729702d921..e57962bb35 100755
--- a/sbin/stop-master.sh
+++ b/sbin/stop-master.sh
@@ -19,13 +19,14 @@
# Stops the master on the machine this script is executed on.
-sbin=`dirname "$0"`
-sbin=`cd "$sbin"; pwd`
+if [ -z "${SPARK_HOME}" ]; then
+ export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
+fi
-. "$sbin/spark-config.sh"
+. "${SPARK_HOME}/sbin/spark-config.sh"
-"$sbin"/spark-daemon.sh stop org.apache.spark.deploy.master.Master 1
+"${SPARK_HOME}/sbin"/spark-daemon.sh stop org.apache.spark.deploy.master.Master 1
-if [ -e "$sbin"/../tachyon/bin/tachyon ]; then
- "$sbin"/../tachyon/bin/tachyon killAll tachyon.master.Master
+if [ -e "${SPARK_HOME}/sbin"/../tachyon/bin/tachyon ]; then
+ "${SPARK_HOME}/sbin"/../tachyon/bin/tachyon killAll tachyon.master.Master
fi