Shutdown on ctrl-C. #59

Merged
merged 1 commit into from May 30, 2013

2 participants

@spraints

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']
end
server = Capybara::Server.new(app)
server.boot
#trap("SIGINT") { exit 0 }
puts server.url('/').inspect
sleep
puts 'done!'

Uncommenting the trap call makes ^C work as expected.

@spraints

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 ?

@abepetrillo
Owner

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 May 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment