From b24297e12c9f48cc4d12083b0bc3484d3cbac6b8 Mon Sep 17 00:00:00 2001 From: Jon Bringhurst Date: Wed, 8 Feb 2023 15:04:24 -0800 Subject: [PATCH] SAMZA-2774: Resolve classpath symlinks --- samza-shell/src/main/bash/run-class.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samza-shell/src/main/bash/run-class.sh b/samza-shell/src/main/bash/run-class.sh index e95ec6d898..e2cb04ea8b 100755 --- a/samza-shell/src/main/bash/run-class.sh +++ b/samza-shell/src/main/bash/run-class.sh @@ -57,7 +57,11 @@ CLASSPATH="" # all the jars need to be appended on newlines to ensure line argument length of 72 bytes is not violated for file in $BASE_LIB_DIR/*.[jw]ar; do - CLASSPATH=$CLASSPATH" $file \n" + # Symlinks need to be resolved here, otherwise, the jars listed in the + # manifest below will point at the first container launched instead of + # the jars at the application level. + resolved_file=$( cd $(dirname $(readlink `[[ $OSTYPE == linux* ]] && echo "-f"` "$file")) ; pwd -P) + CLASSPATH=$CLASSPATH" $resolved_file \n" done echo generated from BASE_LIB_DIR CLASSPATH=$CLASSPATH