From 5247093b82354f8847d879cafa45bea790e3d648 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 14 Feb 2017 13:15:47 -0800 Subject: [PATCH 1/2] Better feedback for failing SSH commands. --- includes/backend.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/backend.inc b/includes/backend.inc index 5d27f97ff8..6a03f04bed 100644 --- a/includes/backend.inc +++ b/includes/backend.inc @@ -1021,6 +1021,9 @@ function _drush_backend_invoke($cmds, $common_backend_options = array(), $contex } $result_code = drush_shell_proc_open($exec_cmd); + if ($result_code > 0) { + drush_print(dt('Command returned error code !code, this could indicate a problem with SSH.', array('!code' => $result_code))); + } $ret = array('error_status' => $result_code); } } From 76559e6b736d009a56c717734f7c6657ce91b330 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 14 Feb 2017 13:21:12 -0800 Subject: [PATCH 2/2] Reduce SSH connection timeout --- includes/backend.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/backend.inc b/includes/backend.inc index 6a03f04bed..167b6cc8c0 100644 --- a/includes/backend.inc +++ b/includes/backend.inc @@ -1163,7 +1163,7 @@ function _drush_backend_generate_command($site_record, $command, $args = array() if (isset($hostname)) { $username = (isset($username)) ? drush_escapeshellarg($username, "LOCAL") . "@" : ''; $ssh_options = $site_record['ssh-options']; - $ssh_options = (isset($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no"); + $ssh_options = (isset($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no -o ConnectTimeout=10"); $ssh_cmd[] = "ssh"; $ssh_cmd[] = $ssh_options;