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/ \
|
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||||
set -eux && \
|
set -eux && \
|
||||||
INSTALL_PKGS="bash \
|
INSTALL_PKGS="bash \
|
||||||
findutils \
|
|
||||||
shadow-utils \
|
shadow-utils \
|
||||||
java-21-openjdk-headless" && \
|
java-21-openjdk-headless" && \
|
||||||
microdnf -y install \
|
microdnf -y install \
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||||
set -eux && \
|
set -eux && \
|
||||||
INSTALL_PKGS="bash \
|
INSTALL_PKGS="bash \
|
||||||
findutils \
|
|
||||||
java-21-openjdk-headless" && \
|
java-21-openjdk-headless" && \
|
||||||
microdnf -y install \
|
microdnf -y install \
|
||||||
--disablerepo="*" \
|
--disablerepo="*" \
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||||
set -eux && \
|
set -eux && \
|
||||||
INSTALL_PKGS="bash \
|
INSTALL_PKGS="bash \
|
||||||
findutils \
|
|
||||||
shadow-utils \
|
shadow-utils \
|
||||||
java-21-openjdk-headless" && \
|
java-21-openjdk-headless" && \
|
||||||
microdnf -y install \
|
microdnf -y install \
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,7 @@ source "${ENTRYPOINT_LIBS}/logging.sh"
|
||||||
: "${JAVA:=/usr/bin/java}"
|
: "${JAVA:=/usr/bin/java}"
|
||||||
readonly ZBX_GATEWAY_CONFIG="${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml"
|
readonly ZBX_GATEWAY_CONFIG="${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml"
|
||||||
readonly ZABBIX_JAVA_DIR="/usr/sbin/zabbix_java"
|
readonly ZABBIX_JAVA_DIR="/usr/sbin/zabbix_java"
|
||||||
|
readonly JAVA_CLASSPATH="lib/*:bin/*:ext_lib/*"
|
||||||
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"
|
|
||||||
}
|
|
||||||
|
|
||||||
run_service() {
|
run_service() {
|
||||||
info "** Preparing Zabbix Java Gateway"
|
info "** Preparing Zabbix Java Gateway"
|
||||||
|
|
@ -31,9 +20,6 @@ run_service() {
|
||||||
|
|
||||||
cd "$ZABBIX_JAVA_DIR"
|
cd "$ZABBIX_JAVA_DIR"
|
||||||
|
|
||||||
local classpath
|
|
||||||
classpath="$(build_classpath)"
|
|
||||||
|
|
||||||
local -a java_opts=(
|
local -a java_opts=(
|
||||||
-server
|
-server
|
||||||
"-Dlogback.configurationFile=${ZBX_GATEWAY_CONFIG}"
|
"-Dlogback.configurationFile=${ZBX_GATEWAY_CONFIG}"
|
||||||
|
|
@ -57,7 +43,7 @@ run_service() {
|
||||||
local -a cmd=(
|
local -a cmd=(
|
||||||
"$JAVA"
|
"$JAVA"
|
||||||
"${java_opts[@]}"
|
"${java_opts[@]}"
|
||||||
-classpath "$classpath"
|
-classpath "$JAVA_CLASSPATH"
|
||||||
"${zabbix_opts[@]}"
|
"${zabbix_opts[@]}"
|
||||||
com.zabbix.gateway.JavaGateway
|
com.zabbix.gateway.JavaGateway
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue