diff -urN zabbix-6.0.38.orig/src/zabbix_java/lib/logback.xml zabbix-6.0.38/src/zabbix_java/lib/logback.xml --- zabbix-6.0.38.orig/src/zabbix_java/lib/logback.xml 2025-02-06 10:05:14.762067735 +0200 +++ zabbix-6.0.38/src/zabbix_java/lib/logback.xml 2025-02-06 10:05:35.122061249 +0200 @@ -2,10 +2,10 @@ - /tmp/zabbix_java.log + /var/log/zabbix/zabbix_java_gateway.log - /tmp/zabbix_java.log.%i + /var/log/zabbix/zabbix_java_gateway.log.%i 1 3 diff -urN zabbix-6.0.38.orig/src/zabbix_java/settings.sh zabbix-6.0.38/src/zabbix_java/settings.sh --- zabbix-6.0.38.orig/src/zabbix_java/settings.sh 2025-02-06 10:05:14.762067735 +0200 +++ zabbix-6.0.38/src/zabbix_java/settings.sh 2025-02-06 10:05:35.122061249 +0200 @@ -24,7 +24,7 @@ # Default: # PID_FILE= -PID_FILE="/tmp/zabbix_java.pid" +PID_FILE="/var/run/zabbix/zabbix_java_gateway.pid" ### Option: zabbix.startPollers # Number of worker threads to start. diff -urN zabbix-6.0.38.orig/src/zabbix_java/shutdown.sh zabbix-6.0.38/src/zabbix_java/shutdown.sh --- zabbix-6.0.38.orig/src/zabbix_java/shutdown.sh 2025-02-06 10:05:14.762067735 +0200 +++ zabbix-6.0.38/src/zabbix_java/shutdown.sh 2025-02-06 10:05:35.122061249 +0200 @@ -1,7 +1,14 @@ #!/bin/sh -cd `dirname $0` -. ./settings.sh +if [ -r /etc/zabbix/zabbix_java_gateway.conf ]; then + . /etc/zabbix/zabbix_java_gateway.conf +fi + +if [ -z $GATEWAY_HOME ]; then + GATEWAY_HOME="/usr/share/zabbix-java-gateway" +fi + +cd $GATEWAY_HOME if [ -n "$PID_FILE" ]; then if [ -f "$PID_FILE" ]; then diff -urN zabbix-6.0.38.orig/src/zabbix_java/startup.sh zabbix-6.0.38/src/zabbix_java/startup.sh --- zabbix-6.0.38.orig/src/zabbix_java/startup.sh 2025-02-06 10:05:14.762067735 +0200 +++ zabbix-6.0.38/src/zabbix_java/startup.sh 2025-02-06 10:06:26.222043946 +0200 @@ -1,7 +1,17 @@ #!/bin/sh -cd `dirname $0` -. ./settings.sh +if [ -r /etc/zabbix/zabbix_java_gateway.conf ]; then + . /etc/zabbix/zabbix_java_gateway.conf +fi + +if [ -z $GATEWAY_HOME ]; then + GATEWAY_HOME="/usr/share/zabbix-java-gateway" +fi + +for f in /etc/zabbix/zabbix_java_gateway*.env; do + . $f + break +done if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then PID=`cat "$PID_FILE"` @@ -15,9 +25,9 @@ JAVA=${JAVA:-java} JAVA_OPTIONS="$JAVA_OPTIONS -server" -if [ -z "$PID_FILE" ]; then - JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml" -fi +JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml" + +cd $GATEWAY_HOME CLASSPATH="lib" for jar in lib/*.jar bin/*.jar; do