Skip to content

Commit

Permalink
Passing run instead of start to jetty.sh (and forcing to background) …
Browse files Browse the repository at this point in the history
…as a work-around for Jetty 10 start-stop-daemon failure on Ubuntu 22.04. Maybe jetty/jetty.project#7008 was closed prematurely?
  • Loading branch information
trautmane committed Mar 11, 2023
1 parent 17c4fb6 commit 61f47e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ sudo -u mongodb /usr/bin/mongod -f /etc/mongod.conf &
echo """
Install 8. Start Jetty
"""
deploy/jetty_base/jetty_wrapper.sh start

# reset terminal that gets messed up by jetty start failure
reset
echo """
Hack: Passing run instead of start to jetty.sh (and forcing to background)
to work-around startup failure.
See https://github.com/eclipse/jetty.project/issues/7008 and
https://github.com/eclipse/jetty.project/issues/7095
"""
deploy/jetty_base/jetty_wrapper.sh run &

# hack that waits for web service to start up successfully by retrying GET request ...
wget --tries=20 "http://localhost:8080/render-ws/v1/owner/demo/project/example_1/stack/v1_acquire"
echo """
sleeping 10 to give jetty a chance to start up
"""
sleep 10

# exit immediately after any client script call failure
set -e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#!/bin/bash

# https://www.eclipse.org/jetty/documentation/jetty-10/operations-guide/index.html#og-quick-setup
# --------------------------------
# Quick setup as documented here:
# https://www.eclipse.org/jetty/documentation/jetty-10/operations-guide/index.html#og-quick-setup
#
# After building janelia-render:latest-example image:
# docker run -it --entrypoint /bin/bash --rm janelia-render:latest-example
# cd deploy
# ../render-ws-java-client/src/main/resources/example_1/run_jetty_quick_setup.sh

set -e

DEPLOY_DIR=$(readlink -m .)
JETTY_HOME=$(readlink -m "${DEPLOY_DIR}/jetty-home-*")
JETTY_HOME=$(readlink -m "${DEPLOY_DIR}"/jetty-home-*)
export JETTY_HOME
export JETTY_BASE="${DEPLOY_DIR}/jetty-base-quick"

JAVA_HOME=$(readlink -m "${DEPLOY_DIR}/*jdk*")
JAVA_HOME=$(readlink -m "${DEPLOY_DIR}"/*jdk*)
export JAVA_HOME

export PATH="${JAVA_HOME}/bin:${PATH}"
Expand All @@ -17,6 +25,6 @@ export JAVA="${JAVA_HOME}/bin/java"
mkdir -p "${JETTY_BASE}"
cd "${JETTY_BASE}"

java -jar "${JETTY_HOME}/start.jar" --add-module=server,http
java -jar "${JETTY_HOME}"/start.jar --add-module=server,http

"${JETTY_HOME}/bin/jetty.sh" start
"${JETTY_HOME}"/bin/jetty.sh start

0 comments on commit 61f47e4

Please sign in to comment.