I am running a Middleman (which uses Webrick) server on JRuby inside a JVM process using the org.jruby.embed.ScriptingContainer
API.
If I shutdown cleanly a
Looks like kill -9
does not trigger the shutdownHook, but kill -15
does.
This StackOverflow question has a detailed answer to the same problem.
Bottom line is, you're screwed, as there doesn't seem to exist any way to intercept a kill -9
signal and perform some maintenance tasks before the JVM halts.