From 2a04d94cf1197e4a282c0d12aee2b0a8b2d00dec Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Tue, 27 Aug 2019 15:25:47 -0700 Subject: [PATCH] Use exec when launching the JVM in CLI's shell script Previously, when the Spring Boot CLI ran the Java command line for an application it did a straight invocation which suppressed propagation of signals to the JVM in certain circumstances (e.g within Docker containers). This change prepends the command with exec which causes the Java process to replace the script process in a shell ensuring that signals are propagated to the Java process without suppression. See gh-17976 Signed-off-by: Ben Hale --- .../spring-boot-cli/src/main/executablecontent/bin/spring | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring b/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring index 5953917b3f..b7ae2ae014 100755 --- a/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring +++ b/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring @@ -113,4 +113,4 @@ if $cygwin; then fi IFS=" " read -r -a javaOpts <<< "$JAVA_OPTS" -"${JAVA_HOME}/bin/java" "${javaOpts[@]}" -cp "$CLASSPATH" org.springframework.boot.loader.JarLauncher "$@" +exec "${JAVA_HOME}/bin/java" "${javaOpts[@]}" -cp "$CLASSPATH" org.springframework.boot.loader.JarLauncher "$@"