Hosted by:
SourceForge

wrapper.on_exit.<n> Property
wrapper.on_exit.<n> Property
Configuration Property Overview
wrapper.on_exit.<n>

Some applications are good about returning exit codes with meaning. In such cases it may be desirable to restart the application in the event that it exits with certain exit codes. This set of properties makes this possible.

If it possible to specify an action to take for any exit code by making use of the wrapper.on_exit.default property and setting it to either SHUTDOWN or RESTART. The default on_exit property defaults to SHUTDOWN.

Example:
wrapper.on_exit.default=RESTART

In addition, it is possible to specify what will happen for a specific exit code by defining a property whose name is wrapper.on_exit. followed by the exit code. The value is set to either SHUTDOWN or RESTART. If an on_exit property is not defined for a given exit code then it will default to the value of the wrapper.on_exit.default property.

Example:
wrapper.on_exit.1=RESTART

To configure the Wrapper to restart the JVM for all exit codes except the exit code 0, use the following:

Example:
wrapper.on_exit.default=RESTART
wrapper.on_exit.0=SHUTDOWN

on_exit properties will be triggered by calls to WrapperManager.stop(n), WrapperManager.stopImmediate(n), and System.exit(n).

External signals or actions which trigger the shutdown of the Wrapper and its JVM will cause these properties to be ignored as the Wrapper is shutting down. This means configuring the Wrapper to restart on any exit code will not prevent the Wrapper from shutting down.

by Leif Mortenson

last modified: