# File lib/chef/application.rb, line 26 def initialize super trap("TERM") do Chef::Application.fatal!("SIGTERM received, stopping", 1) end trap("INT") do Chef::Application.fatal!("SIGINT received, stopping", 2) end unless RUBY_PLATFORM =~ /mswin|mingw32|windows/ trap("HUP") do Chef::Log.info("SIGHUP received, reconfiguring") reconfigure end end at_exit do # tear down the logger end # Always switch to a readable directory. Keeps subsequent Dir.chdir() {} # from failing due to permissions when launched as a less privileged user. end