From c39a55a27043fc0a49005ba7c7eea3f71c02fa45 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 11 Jan 2016 17:57:38 +0000 Subject: [PATCH] Fix quoting of start-stop-daemon RUN_ARGS and JAVA_OPTS in launch script 81a4763 introduced a regression when multiple RUN_ARGS or JAVA_OPTS were configured. Rather than the JVM being launched with multiple arguments all of the RUN_ARGS or JAVA_OPTS were passed as a single argument. This caused unexpected behaviour and typically caused the application to fail to start. This commit updates the quoting of the arguments the are supplied when launching the app using start-stop-daemon so that space-separated entries in RUN_ARGS and JAVA_OPTS remain separate. Closes gh-4866 --- .../org/springframework/boot/loader/tools/launch.script | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script b/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script index b3af16348b7..0e80f4eac8f 100755 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script @@ -147,6 +147,7 @@ do_start() { chown "$run_user" "$pid_file" chown "$run_user" "$log_file" if [ "${useStartStopDaemon:-true}" = true ] && type start-stop-daemon > /dev/null 2>&1; then + arguments="-Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -jar $jarfile $RUN_ARGS $*" start-stop-daemon --start --quiet \ --chuid "$run_user" \ --name "$identity" \ @@ -154,9 +155,7 @@ do_start() { --background --no-close \ --startas "$javaexe" \ --chdir "$working_dir" \ - -- \ - -Dsun.misc.URLClassPath.disableJarChecking=true "${JAVA_OPTS[@]}" \ - -jar "$jarfile" "${RUN_ARGS[@]}" "$@" \ + -- $arguments \ >> "$log_file" 2>&1 await_file "$pid_file" else