Commit c39a55a2 authored by Andy Wilkinson's avatar Andy Wilkinson

Fix quoting of start-stop-daemon RUN_ARGS and JAVA_OPTS in launch script

81a47639 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
parent 04fe55a2
...@@ -147,6 +147,7 @@ do_start() { ...@@ -147,6 +147,7 @@ do_start() {
chown "$run_user" "$pid_file" chown "$run_user" "$pid_file"
chown "$run_user" "$log_file" chown "$run_user" "$log_file"
if [ "${useStartStopDaemon:-true}" = true ] && type start-stop-daemon > /dev/null 2>&1; then 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 \ start-stop-daemon --start --quiet \
--chuid "$run_user" \ --chuid "$run_user" \
--name "$identity" \ --name "$identity" \
...@@ -154,9 +155,7 @@ do_start() { ...@@ -154,9 +155,7 @@ do_start() {
--background --no-close \ --background --no-close \
--startas "$javaexe" \ --startas "$javaexe" \
--chdir "$working_dir" \ --chdir "$working_dir" \
-- \ -- $arguments \
-Dsun.misc.URLClassPath.disableJarChecking=true "${JAVA_OPTS[@]}" \
-jar "$jarfile" "${RUN_ARGS[@]}" "$@" \
>> "$log_file" 2>&1 >> "$log_file" 2>&1
await_file "$pid_file" await_file "$pid_file"
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment