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

package info (click to toggle)
tomcat10 10.1.46-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 47,452 kB
  • sloc: java: 372,028; xml: 58,352; jsp: 4,737; sh: 1,381; perl: 324; makefile: 25; ansic: 14
file content (23 lines) | stat: -rw-r--r-- 899 bytes parent folder | download | duplicates (3)
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
@@ -473,6 +473,10 @@
                 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);