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 @@
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>/tmp/zabbix_java.log</file>
+ <file>/var/log/zabbix/zabbix_java_gateway.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <fileNamePattern>/tmp/zabbix_java.log.%i</fileNamePattern>
+ <fileNamePattern>/var/log/zabbix/zabbix_java_gateway.log.%i</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>3</maxIndex>
</rollingPolicy>
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