From: William Morgan Date: Fri, 7 Aug 2009 00:25:41 +0000 (-0400) Subject: die gracefully upon SIGKILL X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=9edd376555a9b946a1c194582c8de8854da628e2;p=sup die gracefully upon SIGKILL --- 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