views:

203

answers:

1

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!

+1  A: 

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

Anand
I'm working in Rails 2.3.5 - I'm looking for this exact thing but to run in Rails 2.3.5. Thanks!
yuval