summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Bode <bodepd@gmail.com>2011-02-13 02:53:23 -0600
committerLuke Kanies <luke@puppetlabs.com>2011-02-20 15:21:03 -0800
commiteff4eec9d53d4fb8270799458455fe4bdc47d1df (patch)
tree7f08e7a1f5ea6937aef88f30105b9a475957f1fd /lib
parenta54ee1e292238145bb0def2af6cf9ac22f2acd68 (diff)
downloadpuppet-eff4eec9d53d4fb8270799458455fe4bdc47d1df.tar.gz
puppet-eff4eec9d53d4fb8270799458455fe4bdc47d1df.tar.xz
puppet-eff4eec9d53d4fb8270799458455fe4bdc47d1df.zip
(#3) Base application should catch SYSINT
We should exit cleanly rather than throw traces.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/application/data_baseclass.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/application/data_baseclass.rb b/lib/puppet/application/data_baseclass.rb
index 15ea961dc..599a217e9 100644
--- a/lib/puppet/application/data_baseclass.rb
+++ b/lib/puppet/application/data_baseclass.rb
@@ -5,6 +5,14 @@ class Puppet::Application::DataBaseclass < Puppet::Application
should_parse_config
run_mode :agent
+ def preinit
+ super
+ trap(:INT) do
+ $stderr.puts "Cancelling Interface"
+ exit(0)
+ end
+ end
+
option("--debug", "-d") do |arg|
Puppet::Util::Log.level = :debug
end