Automate lifecycle event scripts
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Tomcat servers have the ability to start lifecycle events. These events include the startup and shutdown of a server. Administrators can write scripts to automatically run when these events occur. For example, scripts can start a third-party server when an instance starts. Logically, another script shuts down the third-party server when the instance shuts down. The scripts must be located in the instance-name/bin directory and use the following naming conventions.
| Script | Lifecycle event |
|---|---|
| scriptPrefix_startup.bat|sh | Executes when the Tomcat container is started but before any web application context are created. |
| scriptPrefix_started.bat|sh | Executes when the Tomcat container is started and after all web application contexts are created. |
| scriptPrefix_stopping.bat|sh | Executes before stopping an instance |
| scriptPrefix_shutdown.bat|sh | Executes after stopping an instance. |
Note: Replace the
scriptPrefix with a unique
name for each instance. Scripts execute inline
The startup and shutdown event scripts execute in line which means that the Tomcat startup/shutdown process waits for the event script to complete before continuing. If a script hangs, then it prevents the lifecycle event from completing.