From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.239.171.136 with SMTP id w8cs62440hbe; Sun, 11 Jul 2010 19:49:31 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCM2i09LAAhC4herhBBoEr6eXsA@googlegroups.com designates 10.115.66.26 as permitted sender) client-ip=10.115.66.26; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCM2i09LAAhC4herhBBoEr6eXsA@googlegroups.com designates 10.115.66.26 as permitted sender) smtp.mail=rack-devel+bncCM2i09LAAhC4herhBBoEr6eXsA@googlegroups.com; dkim=pass header.i=rack-devel+bncCM2i09LAAhC4herhBBoEr6eXsA@googlegroups.com Received: from mr.google.com ([10.115.66.26]) by 10.115.66.26 with SMTP id t26mr5953591wak.18.1278902970063 (num_hops = 1); Sun, 11 Jul 2010 19:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:mime-version:message-id:date:to:from :subject:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=9SmL2ldKhrk+ooGY7kWJLQEUOiFzsoclQHICKYvxy5E=; b=2BM7y0IRYuga1i5Sl1LndrGHOr6xdb+btL4r5sikrhkjMaZdd8SHZsGG8Q5IkWuAtg LO7FpRbvP+B+DP03S1DKwG2PBPtqEU1bnrARoMbixJdpfkqQWCA4UnRLiHtt2m176kzx C+fmRvtC4SihERoAFU+djaW3pIow9SMtbpXT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:message-id:date:to:from :subject:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; b=E37207iL4s1oNl/R5GP0SUI333uuq4sTWnknWqmuNdwTh9Oq+2O+2P2tX0n+lkx+Lf QmOscFWpuyQ1VnPl9G+GPHLdbS9JQDysFL80Imh4Z1AL/vIcQXppHE8fOKQ0aInLNwDh 8o8ZNBV6pDb5fWoy6p1A8u91xgV+8TnyTEgvw= Received: by 10.115.66.26 with SMTP id t26mr1210059wak.18.1278902968173; Sun, 11 Jul 2010 19:49:28 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.115.117.31 with SMTP id u31ls2409010wam.3.p; Sun, 11 Jul 2010 19:49:26 -0700 (PDT) Received: by 10.114.160.2 with SMTP id i2mr2885066wae.0.1278902966596; Sun, 11 Jul 2010 19:49:26 -0700 (PDT) Received: by 10.114.160.2 with SMTP id i2mr2885065wae.0.1278902966569; Sun, 11 Jul 2010 19:49:26 -0700 (PDT) Received: from deanbrook.org (deanbrook.org [72.52.70.192]) by gmr-mx.google.com with SMTP id s9si3329915rvl.0.2010.07.11.19.49.26; Sun, 11 Jul 2010 19:49:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stephen.bannasch@deanbrook.org designates 72.52.70.192 as permitted sender) client-ip=72.52.70.192; Received: from ::ffff:71.123.66.245 ([71.123.66.245]) by deanbrook.org for ; Sun, 11 Jul 2010 19:49:04 -0700 Mime-Version: 1.0 Message-Id: Date: Sun, 11 Jul 2010 22:48:56 -0400 To: rack-devel@googlegroups.com From: Stephen Bannasch Subject: ctrl-c not working in Rack::Handler::WEBrick X-Original-Sender: stephen.bannasch@deanbrook.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of stephen.bannasch@deanbrook.org designates 72.52.70.192 as permitted sender) smtp.mail=stephen.bannasch@deanbrook.org Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset="us-ascii" ; format="flowed" After this commit: http://github.com/rack/rack/commit/e516d89ffcdad1c9d58432aaaff4a382ed3997e7 commit e516d89 Author: raggi Date: Tue Mar 23 19:29:44 2010 +0000 Move trap(:INT) to Rack::Server and support optional Handler protocol where handlers may implement .shutdown to do pre-exit cleanup. CTRL-C no longer works to shut down webrick. I've created an issue here: http://github.com/rack/rack/issues/#issue/35 Here's a trivial rack app with a webrick handler that shows the problem: require 'rack' app = proc do |env| [200, { 'Content-Type' => 'text/html' }, 'hello from rack and webrick'] end server = ::Rack::Handler::WEBrick server.run app, :Port => 3002 Run this and try typing ctrl-c in the console: $ ruby hellorack.rb [2010-07-11 22:34:35] INFO WEBrick 1.3.1 [2010-07-11 22:34:35] INFO ruby 1.9.1 (2010-01-10) [i386-darwin9.8.0] [2010-07-11 22:34:35] INFO WEBrick::HTTPServer#start: pid=82455 port=3002 ^C[2010-07-11 22:34:37] ERROR Interrupt: /Users/stephen/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/server.rb:90:in `select' An error is displayed but the program does not quit. In this simple example the code at lib/rack/server.rb:208 is never executed and no handler is actually registered for ctrl-c: trap(:INT) do if server.respond_to?(:shutdown) server.shutdown else exit end end Rack::Handler instances don't appear to be related to Rack::Server instances.