Menu

#118 Restart after crash: only if exit code is a specified one

Future
open
nobody
None
5
2020-11-02
2017-06-11
Bleuzen
No

Hi, there is an option "Restart the application after a crash", but this also restarts the app if, for example, Java crashes.

I would like to set up a exit code, for example 100, and the app should only restart if the exit code of my java app is 100.

Discussion

  • srzc

    srzc - 2017-09-07

    Hi, I would vote for this request to.

    Currently we see the following situation. A client application restarts itself after a server connection loss with the combination of System.exit(100); and restartOnCrash=true. This works as expected.

    In some cases the client cannot be started due to a JVM crash. We had this in case there was not enough memory available. In this case restartOnCrash=true forces launch4j to start the client again and again and again. This also results in an endless loop of the appearing and disappearing splash screen. (looks a little funny :) We could prevent this with a setting like restartOnExitCode=100.

    Best wishes
    Stefan

     
  • Dan Gravell

    Dan Gravell - 2018-03-06

    Agree with this. The current functionality is not usable for us. I would expect to be able to define an exit code or range of codes that allow restart.

     
  • Per

    Per - 2018-11-21

    I agree, having a way to specify one specific exit code would be great (if there is no other way to trigger a restart-signal?)
    In our case we have additional VM parameters added to the l4j.ini file during startup when we do an "application update" and therefore would want a restart. Currently we display a notification that restart is needed which is less user friendly.

    Any workaround for this scenario?

     
  • unicate

    unicate - 2020-11-02

    This is very important, in order to update a java application (using update4j for example)

    I would expect an optional attribute in the xml where I can define a specific return code (between 3? and 255). Whenever the java application returns the code defined in the xml restart anyway.

     
  • unicate

    unicate - 2020-11-02
     

Log in to post a comment.