From: Emmanuel Bourg <ebourg@apache.org>
Date: Mon, 16 Jan 2023 23:22:18 +0100
Subject: Fix the exit status when Tomcat terminates because the configuration
 is invalid

Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=62607
---
 java/org/apache/catalina/startup/Bootstrap.java | 4 ++++
 1 file changed, 4 insertions(+)

--- a/java/org/apache/catalina/startup/Bootstrap.java
+++ b/java/org/apache/catalina/startup/Bootstrap.java
@@ -470,6 +470,10 @@ public final class Bootstrap {
                 case "start":
                     daemon.setAwait(true);
                     daemon.load(args);
+                if (null == daemon.getServer()) {
+                    log.fatal("Cannot start server. Server instance is not configured.");
+                    System.exit(1);
+                }
                     daemon.start();
                     if (null == daemon.getServer()) {
                         System.exit(1);
