Search code examples
ruby-on-railsrubydaemoninitializer

Stop daemon with server in Ruby on Rails


I have a daemon that I'm starting along with the server using an initializer file. I want to stop this daemon once the server stops, but I'm not sure where to put a script that would run when the server stops.

Initializers get automatically loaded when the server starts. Is there a similar "destroyers" folder? Where would I put code that I want to run when the server stops?

Thanks!


Solution

  • Here's a link that might be of interest, http://github.com/costan/daemonz