summaryrefslogtreecommitdiff
path: root/network/zabbix_java_gateway/java-gateway.patch
blob: 5ee278e2729c2c0272ba0905b9be83838db68f02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
diff -urN 5.4.orig/src/zabbix_java/lib/logback.xml 5.4/src/zabbix_java/lib/logback.xml
--- 5.4.orig/src/zabbix_java/lib/logback.xml	2021-02-03 14:46:36.510530149 +0200
+++ 5.4/src/zabbix_java/lib/logback.xml	2021-02-03 16:08:48.139648517 +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 5.4.orig/src/zabbix_java/settings.sh 5.4/src/zabbix_java/settings.sh
--- 5.4.orig/src/zabbix_java/settings.sh	2021-02-03 14:46:36.510530149 +0200
+++ 5.4/src/zabbix_java/settings.sh	2021-02-03 17:30:37.637881653 +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 5.4.orig/src/zabbix_java/shutdown.sh 5.4/src/zabbix_java/shutdown.sh
--- 5.4.orig/src/zabbix_java/shutdown.sh	2021-02-03 14:46:36.510530149 +0200
+++ 5.4/src/zabbix_java/shutdown.sh	2021-02-03 14:54:19.090352858 +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 5.4.orig/src/zabbix_java/startup.sh 5.4/src/zabbix_java/startup.sh
--- 5.4.orig/src/zabbix_java/startup.sh	2021-02-03 14:46:36.510530149 +0200
+++ 5.4/src/zabbix_java/startup.sh	2021-02-03 15:51:17.466224873 +0200
@@ -1,7 +1,12 @@
 #!/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
 
 if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then
 	PID=`cat "$PID_FILE"`
@@ -15,9 +20,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