File: 0025-invalid-configuration-exit-status.patch

package info (click to toggle)
tomcat10 10.1.34-0%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,112 kB
  • sloc: java: 367,834; xml: 56,735; jsp: 4,620; sh: 1,379; perl: 314; makefile: 25; ansic: 15
file content (23 lines) | stat: -rw-r--r-- 930 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 {
             } else if (command.equals("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);