pid-file is not removed when stopping
niko opened this issue · 8 comments
Basically it seams #stop! isn't called. Should be by the trap clause I think, but it isn't. I can't tell why.
can you gist me your script? and how you stop it?
The App.run! is a Sinatra app or has inside a trap?
Can also you test my latest update?
Ah. It's a Sinatra app. And .run! traps :INT and :TERM by itself. My fault. Sry for the fuzz.
No problem man!
The bad thing is that rubys #trap(SIGNAL) get overridden, last one wins. Perhaps using #at_exit instead would be an option? #at_exit hooks ad up, all get executed.
My workaround to handle libs which override the signal traps is to put this into the on_ready block:
at_exit { stop! }
Just in case anybody else is looking for a solution to run a sinatra app with foreverb.