Skip to content

Commit

Permalink
fix: DEBUG suspend supports a variety of binary values
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Jun 30, 2020
1 parent 6d6674c commit 541788d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/s2i-jetty/s2i/run
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ fi

if [ "${JAVA_ENABLE_DEBUG:-false}" = "true" ]; then
echo "Running Jetty in debug mode"
DEBUG_OPTS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=${JAVA_DEBUG_PORT:-5005},server=y,suspend=${JAVA_DEBUG_SUSPEND:-n}"
suspend_mode="n"
if ! echo "${JAVA_DEBUG_SUSPEND:-n}" | grep -q -e '^\(false\|n\|no\|0\)$'; then
suspend_mode="y"
fi
DEBUG_OPTS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=${JAVA_DEBUG_PORT:-5005},server=y,suspend=${suspend_mode}"
fi

eval exec java ${DEBUG_OPTS} -jar "$JETTY_HOME/start.jar"
4 changes: 3 additions & 1 deletion modules/s2i-tomcat/s2i/run
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ if [ -d ${appDir} ]; then
fi

export JPDA_ADDRESS="localhost:${JAVA_DEBUG_PORT:-5005}"
export JPDA_SUSPEND="${JAVA_DEBUG_SUSPEND:-n}"
if ! echo "${JAVA_DEBUG_SUSPEND:-n}" | grep -q -e '^\(false\|n\|no\|0\)$'; then
export JPDA_SUSPEND="y"
fi

if [ "${JAVA_ENABLE_DEBUG:-false}" = "true" ]; then
echo "Running catalina in debug mode ($JPDA_ADDRESS)"
Expand Down

0 comments on commit 541788d

Please sign in to comment.