From de73b65635cc51b802077f6db761ce86d7377eaa Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 10 Aug 2012 00:30:58 -0700 Subject: [PATCH] Very early SIGINTs no longer cause ugly stack traces. We catch INT very very early in the Vagrant process in order to exit cleanly rather than raising any exceptions. This is eventually overriden by Vagrant at some point. --- CHANGELOG.md | 2 ++ bin/vagrant | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce535ac31..94ac615fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ keystrokes such as ctrl-D and ctrl-C are more gracefully handled. [GH-1017] - Fixed bug where port check would use "localhost" on systems where "localhost" is not available. [GH-1057] + - Sending a SIGINT (Ctrl-C) very early on when executing `vagrant` no + longer results in an ugly stack trace. ## 1.0.3 (May 1, 2012) diff --git a/bin/vagrant b/bin/vagrant index 0575b4677..a0fdbd9c4 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -1,4 +1,10 @@ #!/usr/bin/env ruby + +# Trap interrupts to quit cleanly. This will be overriden at some point +# by Vagrant. This is made to catch any interrupts while Vagrant is +# initializing which have historically resulted in stack traces. +Signal.trap("INT") { exit 1 } + require 'log4r' require 'vagrant' require 'vagrant/cli'