From cdba235db62c6be70ee8fb7f4993be2eb53b4698 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 18 Oct 2021 09:39:37 -0500 Subject: [PATCH] Issue #7008 - fix jetty.sh + Minor fix to remove extra LF output in RUN_ARGS + Using start-stop-daemon options properly Signed-off-by: Joakim Erdfelt --- jetty-home/src/main/resources/bin/jetty.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jetty-home/src/main/resources/bin/jetty.sh b/jetty-home/src/main/resources/bin/jetty.sh index 3a429107d13..3fbf9517687 100755 --- a/jetty-home/src/main/resources/bin/jetty.sh +++ b/jetty-home/src/main/resources/bin/jetty.sh @@ -433,7 +433,7 @@ case "`uname`" in CYGWIN*) JETTY_START="`cygpath -w $JETTY_START`";; esac -RUN_ARGS=$(echo $JAVA_OPTIONS ; "$JAVA" -jar "$JETTY_START" --dry-run=opts,path,main,args ${JETTY_ARGS[*]}) +RUN_ARGS=$(echo -ne $JAVA_OPTIONS ; "$JAVA" -jar "$JETTY_START" --dry-run=opts,path,main,args ${JETTY_ARGS[*]}) RUN_CMD=("$JAVA" ${RUN_ARGS[@]}) ##################################################### @@ -462,10 +462,16 @@ case "$ACTION" in unset CH_USER if [ -n "$JETTY_USER" ] then - CH_USER="-c$JETTY_USER" + CH_USER="--chuid $JETTY_USER" fi - start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_BASE" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" start-log-file="$JETTY_START_LOG" + start-stop-daemon --start $CH_USER \ + --pidfile "$JETTY_PID" \ + --chdir "$JETTY_BASE" \ + --background \ + --make-pidfile \ + --startas "$JAVA" \ + -- ${RUN_ARGS[@]} start-log-file="$JETTY_START_LOG" else