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 <bhale@pivotal.io>
pull/18464/head
Ben Hale 5 years ago committed by Andy Wilkinson
parent bd9f7a13f5
commit 2a04d94cf1

@ -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 "$@"

Loading…
Cancel
Save