From 81550392b0659954e00822da02cabd1b303f643d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 12 Jul 2013 06:40:03 +0900 Subject: [PATCH] Close SSH channel after exit status received [GH-603] --- CHANGELOG.md | 2 ++ plugins/communicators/ssh/communicator.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 895b4e32e..f3f1b12ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ BUG FIXES: works properly. [GH-785] - NFS shared folders properly dereference symlinks so that the real path is used, avoiding mount errors [GH-1101] + - SSH channel is closed after the exit status is received, potentially + eliminating any SSH hangs. [GH-603] ## 1.2.3 (July 9, 2013) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 2dea21e33..db7111137 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -282,6 +282,10 @@ module VagrantPlugins ch2.on_request("exit-status") do |ch3, data| exit_status = data.read_long @logger.debug("Exit status: #{exit_status}") + + # Close the channel, since after the exit status we're + # probably done. This fixes up issues with hanging. + channel.close end # Set the terminal