Skip to content


Shutdown on ctrl-C. #59

merged 1 commit into from

2 participants


Make evergreen serve exit on ^C.

In my environment (rails 3.0.9, capybara 1.1.2, thin 1.3.1, evergreen 1.0.0, etc), the above wasn't happening. AFAICT, nothing but kill -9 made it stop.

I was able to reproduce the un-SIGINT-able sleep by running this:

require 'capybara'
app = lambda do |env|
  [200, {'Content-type' => 'text/plain'}, 'ok']
server =
#trap("SIGINT") { exit 0 }
puts server.url('/').inspect
puts 'done!'

Uncommenting the trap call makes ^C work as expected.


Oh yeah, I'm using ruby 1.9.3.

This is related to #5. Do you want me to install handlers for sigquit & sigkill, too, as in TLSLLC@49808a1 ?


Hopefully I can pull this in when I get push access. Tested this with rails 3., and all tests pass. +1

@abepetrillo abepetrillo merged commit b0f50f9 into abepetrillo:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 21, 2012
  1. @spraints

    Shutdown on ctrl-C.

    spraints committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/evergreen/server.rb
1  lib/evergreen/server.rb
@@ -5,6 +5,7 @@ class Server
def serve
server.boot + '/'))
+ trap('SIGINT') { puts 'Shutting down...' ; exit 0 }
Something went wrong with that request. Please try again.