#123 ✓resolved
Nate Wiger

Thin does not obey QUIT / TERM signal under Ruby 1.9

Reported by Nate Wiger | February 3rd, 2010 @ 09:15 PM | in Future

Related to this earlier ticket: https://thin.lighthouseapp.com/projects/7212/tickets/92-thin-fails-...

We've found in our environment that thin never obeys the QUIT/TERM signal sent from "thin stop". As a result, the server is hard KILL'ed, which is of course dangerous when you have something with a DB connection.

Luckily the solution is a simple 2-line patch to thin/daemonizing.rb. In +daemonize+, just tell thin to listen for those signals explicitly:

  trap('TERM') { logger.info ">> Received TERM signal (PID: #{$$})"; exit }
  trap('QUIT') { logger.info ">> Received QUIT signal (PID: #{$$})"; exit }

Patch attached.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Attachments

Referenced by

Pages