From 31b5518fe3e4776949d7fcc842246fca2b1c04ff Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 25 Oct 2023 20:20:50 -0500 Subject: [PATCH] Updates to jetty.sh and testing to reduce failures Backport of #10790 to Jetty 10. + Making sure /etc/default/jetty is populated correctly in the user_change mode + Removing warnings from jetty startup about --start-log-file=... being unrecognized + Adding unique jetty10 identifier to docker image names (helps to keep different jetty versions apart when manually testing) Signed-off-by: Joakim Erdfelt --- jetty-home/src/main/resources/bin/jetty.sh | 4 ++-- .../tests/distribution/jettysh/ImageOSAmazonCorretto11.java | 2 +- .../tests/distribution/jettysh/ImageOSUbuntuJammyJDK17.java | 2 +- .../jetty/tests/distribution/jettysh/ImageUserChange.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jetty-home/src/main/resources/bin/jetty.sh b/jetty-home/src/main/resources/bin/jetty.sh index 1aa18617d833..fff4affd11c7 100755 --- a/jetty-home/src/main/resources/bin/jetty.sh +++ b/jetty-home/src/main/resources/bin/jetty.sh @@ -635,13 +635,13 @@ case "$ACTION" in chown "$JETTY_USER" "$JETTY_PID" su - "$JETTY_USER" $SU_SHELL -c " cd \"$JETTY_BASE\" - echo ${RUN_ARGS[*]} --start-log-file=\"$JETTY_START_LOG\" | xargs ${JAVA} > /dev/null & + echo ${RUN_ARGS[*]} | xargs ${JAVA} > /dev/null & PID=\$! disown \$PID" (( DEBUG )) && echo "Starting: su shell (w/user $JETTY_USER) on PID $PID" else # Startup if not switching users - echo ${RUN_ARGS[*]} --start-log-file="${JETTY_START_LOG}" | xargs ${JAVA} > /dev/null & + echo ${RUN_ARGS[*]} | xargs ${JAVA} > /dev/null & PID=$! disown $PID (( DEBUG )) && echo "Starting: java command on PID $PID" diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSAmazonCorretto11.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSAmazonCorretto11.java index a00483181536..06d6b7d6c0a7 100644 --- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSAmazonCorretto11.java +++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSAmazonCorretto11.java @@ -24,7 +24,7 @@ public class ImageOSAmazonCorretto11 extends ImageOS { public ImageOSAmazonCorretto11() { - super("amazoncorretto-jdk11", + super("amazoncorretto-jdk11-jetty10", builder -> builder .from("amazoncorretto:11.0.20") diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSUbuntuJammyJDK17.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSUbuntuJammyJDK17.java index 963960b85407..04ff42eaf3ca 100644 --- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSUbuntuJammyJDK17.java +++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageOSUbuntuJammyJDK17.java @@ -22,7 +22,7 @@ public class ImageOSUbuntuJammyJDK17 extends ImageOS { public ImageOSUbuntuJammyJDK17() { - super("ubuntu-22.04-jdk17", + super("ubuntu-22.04-jdk17-jetty10", builder -> builder .from("ubuntu:22.04") diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageUserChange.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageUserChange.java index eaf3e86066cd..112efc0874c0 100644 --- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageUserChange.java +++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/jettysh/ImageUserChange.java @@ -31,7 +31,7 @@ public ImageUserChange(ImageOS osImage) "useradd --home-dir=${JETTY_BASE} --shell=/bin/bash jetty ; " + "chown jetty:jetty ${JETTY_BASE} ; " + "chmod a+w ${JETTY_BASE} ; " + - "echo \"JETTY_USER=jetty\" > /etc/default/jetty") // user change + "echo \"JETTY_USER=jetty\" >> /etc/default/jetty") // user change .user("jetty") // Configure Jetty Base .workDir("${JETTY_BASE}")