Using wildcards to search jar files instead of scan directory
This commit is contained in:
parent
4e90d6bcf8
commit
9f0b64527e
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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="*" \
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue