aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2013-12-16 15:23:51 -0800
committerPatrick Wendell <pwendell@gmail.com>2013-12-16 15:23:51 -0800
commit964a3b6971716823f473f672611951d1e489a552 (patch)
treeca541ad9ff460fab8beb30b20115542e1aaf86ac
parent883e034aebe61a25631497b4e299a8f2e3389b00 (diff)
parentd17c142615f7d0ff514a74779e433107659a78b9 (diff)
downloadspark-964a3b6971716823f473f672611951d1e489a552.tar.gz
spark-964a3b6971716823f473f672611951d1e489a552.tar.bz2
spark-964a3b6971716823f473f672611951d1e489a552.zip
Merge pull request #270 from ewencp/really-force-ssh-pseudo-tty-master
Force pseudo-tty allocation in spark-ec2 script. ssh commands need the -t argument repeated twice if there is no local tty, e.g. if the process running spark-ec2 uses nohup and the parent process exits. Without this change, if you run the script this way (e.g. using nohup from a cron job), it will fail setting up the nodes because some of the ssh commands complain about missing ttys and then fail. (This version is for the master branch. I've filed a separate request for the 0.8 since changes to the script caused the patches to be different.)
-rwxr-xr-xec2/spark_ec2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index 1189232428..a2b0e7e7f4 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -589,7 +589,7 @@ def ssh(host, opts, command):
while True:
try:
return subprocess.check_call(
- ssh_command(opts) + ['-t', '%s@%s' % (opts.user, host), stringify_command(command)])
+ ssh_command(opts) + ['-t', '-t', '%s@%s' % (opts.user, host), stringify_command(command)])
except subprocess.CalledProcessError as e:
if (tries > 2):
# If this was an ssh failure, provide the user with hints.
@@ -730,7 +730,7 @@ def real_main():
if opts.proxy_port != None:
proxy_opt = ['-D', opts.proxy_port]
subprocess.check_call(
- ssh_command(opts) + proxy_opt + ['-t', "%s@%s" % (opts.user, master)])
+ ssh_command(opts) + proxy_opt + ['-t', '-t', "%s@%s" % (opts.user, master)])
elif action == "get-master":
(master_nodes, slave_nodes) = get_existing_cluster(conn, opts, cluster_name)