diff options
author | jbencook <jbenjamincook@gmail.com> | 2014-12-09 12:16:19 -0800 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-12-09 12:16:19 -0800 |
commit | 61f1a7022767e64ab092aa91c0c5aa1b2fdbef7c (patch) | |
tree | c91a78af163d7d40412233144e56bed91a0209a1 /sbin/stop-all.sh | |
parent | 912563aa3553afc0871d5b5858f533aa39cb99e5 (diff) | |
download | spark-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/stop-all.sh')
-rwxr-xr-x | sbin/stop-all.sh | 17 |
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 |