aboutsummaryrefslogtreecommitdiff
path: root/sbin/stop-all.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/stop-all.sh')
-rwxr-xr-xsbin/stop-all.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/stop-all.sh b/sbin/stop-all.sh
index 1a9abe07db..4e476ca05c 100755
--- a/sbin/stop-all.sh
+++ b/sbin/stop-all.sh
@@ -20,23 +20,23 @@
# Stop all spark daemons.
# Run this on the master node.
-
-sbin="`dirname "$0"`"
-sbin="`cd "$sbin"; pwd`"
+if [ -z "${SPARK_HOME}" ]; then
+ export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
+fi
# Load the Spark configuration
-. "$sbin/spark-config.sh"
+. "${SPARK_HOME}/sbin/spark-config.sh"
# Stop the slaves, then the master
-"$sbin"/stop-slaves.sh
-"$sbin"/stop-master.sh
+"${SPARK_HOME}/sbin"/stop-slaves.sh
+"${SPARK_HOME}/sbin"/stop-master.sh
if [ "$1" == "--wait" ]
then
printf "Waiting for workers to shut down..."
while true
do
- running=`$sbin/slaves.sh ps -ef | grep -v grep | grep deploy.worker.Worker`
+ running=`${SPARK_HOME}/sbin/slaves.sh ps -ef | grep -v grep | grep deploy.worker.Worker`
if [ -z "$running" ]
then
printf "\nAll workers successfully shut down.\n"