aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorjbencook <jbenjamincook@gmail.com>2014-12-09 12:16:19 -0800
committerPatrick Wendell <pwendell@gmail.com>2014-12-09 12:16:19 -0800
commit61f1a7022767e64ab092aa91c0c5aa1b2fdbef7c (patch)
treec91a78af163d7d40412233144e56bed91a0209a1 /sbin
parent912563aa3553afc0871d5b5858f533aa39cb99e5 (diff)
downloadspark-61f1a7022767e64ab092aa91c0c5aa1b2fdbef7c.tar.gz
spark-61f1a7022767e64ab092aa91c0c5aa1b2fdbef7c.tar.bz2
spark-61f1a7022767e64ab092aa91c0c5aa1b2fdbef7c.zip
[SPARK-874] adding a --wait flag
This PR adds a --wait flag to the `./sbin/stop-all.sh` script. Author: jbencook <jbenjamincook@gmail.com> Closes #3567 from jbencook/master and squashes the following commits: d05c5bb [jbencook] [SPARK-874] adding a --wait flag
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/stop-all.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/sbin/stop-all.sh b/sbin/stop-all.sh
index 298c6a9859..971d5d49da 100755
--- a/sbin/stop-all.sh
+++ b/sbin/stop-all.sh
@@ -30,3 +30,20 @@ sbin="`cd "$sbin"; pwd`"
# Stop the slaves, then the master
"$sbin"/stop-slaves.sh
"$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`
+ if [ -z "$running" ]
+ then
+ printf "\nAll workers successfully shut down.\n"
+ break
+ else
+ printf "."
+ sleep 10
+ fi
+ done
+fi