# File lib/new_relic/agent/agent.rb, line 393
          def install_exit_handler
            return unless should_install_exit_handler?
            NewRelic::Agent.logger.debug("Installing at_exit handler")
            at_exit do
              if need_exit_code_workaround?
                exit_status = $!.status if $!.is_a?(SystemExit)
                shutdown
                exit exit_status if exit_status
              else
                shutdown
              end
            end
          end