I was trying to use a warbled project with the Apache commons-daemon service wrapper in windows which is called procrun.
When the warbled process would exit it was calling System.exit in the normal flow and this was causing an exception for the service wrapper (pipe broken error 109). In searching for the problem, I found that it said any child process should not call System.exit.
So assuming that System.exit is needed in some situations, I added a system property called warbler.skip_system_exit which if defined cause JarMain to not call System.exit in the normal exit flow and this solves the problem for when used with procrun. Thus it could be used with or without System.exit being called depending on whether property is defined.
I did not know how to write a test for this, but I have verified that it solves the problem when I enable the switch.
I also did not build the warbler_jar.jar yet since I had issue getting dev environment setup, so we will need to do that yet for it to take effect.
Feel free to change the property name or whatever you think is best to get this into the JarMain.
add warbler.skip_system_exit system property which if defined causes …
…JarMain to not use System.exit in the non-error flow. This fixes issue with using a service wrapper like procrun
@jeffbski Sorry that no one responded to this until now. Somewhat incredibly, it appears that we can still merge this. It seems reasonable, and I'd like to merge it. Do you mind adding a test, and perhaps documentation for it?
@BanzaiMan I wish I could but all my work with that was at my last company and I don't even have a jruby environment setup currently (doing all my current work in node.js).
Merge pull request #22 from jeffbski/master
added system property to allow JarMain to not use System.exit in normal flow, this was causing problem when using a service wrapper
OK. I'll see what I can do with regards to documentation. Again, thanks for your help.