File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ public void run() {
129129 public static void main (String [] args ) {
130130 try {
131131 int exit = new JarMain (args ).start ();
132- System .exit (exit );
132+ if ( isSystemExitEnabled ()) System .exit (exit );
133133 } catch (Exception e ) {
134134 Throwable t = e ;
135135 while (t .getCause () != null && t .getCause () != t ) {
@@ -146,4 +146,13 @@ public static void main(String[] args) {
146146 private static boolean isDebug () {
147147 return System .getProperty ("warbler.debug" ) != null ;
148148 }
149+
150+ /**
151+ * if warbler.skip_system_exit system property is defined, we will not
152+ * call System.exit in the normal flow. System.exit can cause problems
153+ * for wrappers like procrun
154+ */
155+ private static boolean isSystemExitEnabled (){
156+ return System .getProperty ("warbler.skip_system_exit" ) == null ; //omission enables System.exit use
157+ }
149158}
You can’t perform that action at this time.
0 commit comments