Blame SOURCES/java-gateway.patch

9189c1
diff -urN 5.4.orig/src/zabbix_java/lib/logback.xml 5.4/src/zabbix_java/lib/logback.xml
9189c1
--- 5.4.orig/src/zabbix_java/lib/logback.xml	2021-02-03 14:46:36.510530149 +0200
9189c1
+++ 5.4/src/zabbix_java/lib/logback.xml	2021-02-03 16:08:48.139648517 +0200
9189c1
@@ -2,10 +2,10 @@
9189c1
 
9189c1
 	<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
9189c1
 
9189c1
-		<file>/tmp/zabbix_java.log</file>
9189c1
+		<file>/var/log/zabbix/zabbix_java_gateway.log</file>
9189c1
 
9189c1
 		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
9189c1
-			<fileNamePattern>/tmp/zabbix_java.log.%i</fileNamePattern>
9189c1
+			<fileNamePattern>/var/log/zabbix/zabbix_java_gateway.log.%i</fileNamePattern>
9189c1
 			<minIndex>1</minIndex>
9189c1
 			<maxIndex>3</maxIndex>
9189c1
 		</rollingPolicy>
9189c1
diff -urN 5.4.orig/src/zabbix_java/settings.sh 5.4/src/zabbix_java/settings.sh
9189c1
--- 5.4.orig/src/zabbix_java/settings.sh	2021-02-03 14:46:36.510530149 +0200
9189c1
+++ 5.4/src/zabbix_java/settings.sh	2021-02-03 17:30:37.637881653 +0200
9189c1
@@ -24,7 +24,7 @@
9189c1
 # Default:
9189c1
 # PID_FILE=
9189c1
 
9189c1
-PID_FILE="/tmp/zabbix_java.pid"
9189c1
+PID_FILE="/var/run/zabbix/zabbix_java_gateway.pid"
9189c1
 
9189c1
 ### Option: zabbix.startPollers
9189c1
 #	Number of worker threads to start.
9189c1
diff -urN 5.4.orig/src/zabbix_java/shutdown.sh 5.4/src/zabbix_java/shutdown.sh
9189c1
--- 5.4.orig/src/zabbix_java/shutdown.sh	2021-02-03 14:46:36.510530149 +0200
9189c1
+++ 5.4/src/zabbix_java/shutdown.sh	2021-02-03 14:54:19.090352858 +0200
9189c1
@@ -1,7 +1,14 @@
9189c1
 #!/bin/sh
9189c1
 
9189c1
-cd `dirname $0`
9189c1
-. ./settings.sh
9189c1
+if [ -r /etc/zabbix/zabbix_java_gateway.conf ]; then
9189c1
+	. /etc/zabbix/zabbix_java_gateway.conf
9189c1
+fi
9189c1
+
9189c1
+if [ -z $GATEWAY_HOME ]; then
9189c1
+	GATEWAY_HOME="/usr/share/zabbix-java-gateway"
9189c1
+fi
9189c1
+
9189c1
+cd $GATEWAY_HOME
9189c1
 
9189c1
 if [ -n "$PID_FILE" ]; then
9189c1
 	if [ -f "$PID_FILE" ]; then
9189c1
diff -urN 5.4.orig/src/zabbix_java/startup.sh 5.4/src/zabbix_java/startup.sh
9189c1
--- 5.4.orig/src/zabbix_java/startup.sh	2021-02-03 14:46:36.510530149 +0200
9189c1
+++ 5.4/src/zabbix_java/startup.sh	2021-02-03 15:51:17.466224873 +0200
9189c1
@@ -1,7 +1,12 @@
9189c1
 #!/bin/sh
9189c1
 
9189c1
-cd `dirname $0`
9189c1
-. ./settings.sh
9189c1
+if [ -r /etc/zabbix/zabbix_java_gateway.conf ]; then
9189c1
+	. /etc/zabbix/zabbix_java_gateway.conf
9189c1
+fi
9189c1
+
9189c1
+if [ -z $GATEWAY_HOME ]; then
9189c1
+	GATEWAY_HOME="/usr/share/zabbix-java-gateway"
9189c1
+fi
9189c1
 
9189c1
 if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then
9189c1
 	PID=`cat "$PID_FILE"`
9189c1
@@ -15,9 +20,9 @@
9189c1
 JAVA=${JAVA:-java}
9189c1
 
9189c1
 JAVA_OPTIONS="$JAVA_OPTIONS -server"
9189c1
-if [ -z "$PID_FILE" ]; then
9189c1
-	JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml"
9189c1
-fi
9189c1
+JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml"
9189c1
+
9189c1
+cd $GATEWAY_HOME
9189c1
 
9189c1
 CLASSPATH="lib"
9189c1
 for jar in lib/*.jar bin/*.jar; do