From 9edd376555a9b946a1c194582c8de8854da628e2 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Thu, 6 Aug 2009 20:25:41 -0400 Subject: [PATCH] die gracefully upon SIGKILL --- bin/sup | 2 +- lib/sup/suicide.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/sup b/bin/sup index 2d5de67..b87c112 100755 --- a/bin/sup +++ b/bin/sup @@ -160,7 +160,7 @@ begin Redwood::start Index.load - trap("TERM") { |x| raise "so speaking as i think, i die, i die!" } + trap("TERM") { |x| SuicideManager.please_die! } trap("WINCH") { |x| BufferManager.sigwinch_happened! } if(s = Redwood::SourceManager.source_for DraftManager.source_name) diff --git a/lib/sup/suicide.rb b/lib/sup/suicide.rb index 98b4346..53f31a5 100644 --- a/lib/sup/suicide.rb +++ b/lib/sup/suicide.rb @@ -14,6 +14,7 @@ class SuicideManager end bool_reader :die + def please_die!; @die = true end def start @thread = Redwood::reporting_thread("suicide watch") do -- 2.43.0