Using wildcards to search jar files instead of scan directory

This commit is contained in:
Alexey Pustovalov 2026-07-24 21:27:15 +09:00
parent 4e90d6bcf8
commit 9f0b64527e
4 changed files with 2 additions and 19 deletions

View file

@ -37,7 +37,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
findutils \
shadow-utils \
java-21-openjdk-headless" && \
microdnf -y install \

View file

@ -37,7 +37,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
findutils \
java-21-openjdk-headless" && \
microdnf -y install \
--disablerepo="*" \

View file

@ -56,7 +56,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
findutils \
shadow-utils \
java-21-openjdk-headless" && \
microdnf -y install \

View file

@ -9,18 +9,7 @@ source "${ENTRYPOINT_LIBS}/logging.sh"
: "${JAVA:=/usr/bin/java}"
readonly ZBX_GATEWAY_CONFIG="${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml"
readonly ZABBIX_JAVA_DIR="/usr/sbin/zabbix_java"
build_classpath() {
local classpath
local jar
classpath="lib"
while IFS= read -r -d '' jar; do
classpath="${classpath}:$jar"
done < <(find lib bin ext_lib -name '*.jar' -print0)
printf '%s\n' "$classpath"
}
readonly JAVA_CLASSPATH="lib/*:bin/*:ext_lib/*"
run_service() {
info "** Preparing Zabbix Java Gateway"
@ -31,9 +20,6 @@ run_service() {
cd "$ZABBIX_JAVA_DIR"
local classpath
classpath="$(build_classpath)"
local -a java_opts=(
-server
"-Dlogback.configurationFile=${ZBX_GATEWAY_CONFIG}"
@ -57,7 +43,7 @@ run_service() {
local -a cmd=(
"$JAVA"
"${java_opts[@]}"
-classpath "$classpath"
-classpath "$JAVA_CLASSPATH"
"${zabbix_opts[@]}"
com.zabbix.gateway.JavaGateway
)