git: 09dc4af0af41 - 2023Q1 - sysutils/graylog: enable using alternate JVM versions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 11 Jan 2023 21:09:07 UTC
The branch 2023Q1 has been updated by dch:
URL: https://cgit.FreeBSD.org/ports/commit/?id=09dc4af0af41c83e913d91ecb8593e4cbcf8892d
commit 09dc4af0af41c83e913d91ecb8593e4cbcf8892d
Author: Einar Bjarni Halldórsson <einar@isnic.is>
AuthorDate: 2023-01-11 20:53:39 +0000
Commit: Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2023-01-11 21:06:21 +0000
sysutils/graylog: enable using alternate JVM versions
Future graylog versions in the 5.x series require both newer
java versions, and migration from ElasticSearch to OpenSearch.
This patch helps smooth the migration path.
Reported by: Einar Bjarni Halldórsson <einar@isnic.is>
---
sysutils/graylog/Makefile | 6 ++++--
sysutils/graylog/files/graylog.in | 7 +++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/sysutils/graylog/Makefile b/sysutils/graylog/Makefile
index da6582b23829..19049f6d91d8 100644
--- a/sysutils/graylog/Makefile
+++ b/sysutils/graylog/Makefile
@@ -1,5 +1,6 @@
PORTNAME= graylog
DISTVERSION= 4.3.9
+PORTREVISION= 1
CATEGORIES= sysutils java
MASTER_SITES= https://downloads.graylog.org/releases/
DISTFILES= graylog/${DISTNAME}${EXTRACT_SUFX} \
@@ -18,7 +19,7 @@ LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
USES= cpe tar:tgz
USE_JAVA= yes
-JAVA_VERSION= 1.8+
+JAVA_VERSION= 8+
JAVA_EXTRACT= yes
JAVA_RUN= yes
@@ -38,7 +39,8 @@ GRAYLOG_LOGS_DIR= /var/log/graylog
SUB_LIST= GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR} \
GRAYLOG_LOGS_DIR=${GRAYLOG_LOGS_DIR} \
GRAYLOGGROUP=${GRAYLOGGROUP} \
- GRAYLOGUSER=${GRAYLOGUSER}
+ GRAYLOGUSER=${GRAYLOGUSER} \
+ JAVA_HOME=${JAVA_HOME}
PLIST_SUB= DISTVERSION=${DISTVERSION} \
GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR} \
diff --git a/sysutils/graylog/files/graylog.in b/sysutils/graylog/files/graylog.in
index 3530a2a57120..24d9b77c225a 100644
--- a/sysutils/graylog/files/graylog.in
+++ b/sysutils/graylog/files/graylog.in
@@ -45,6 +45,10 @@
# graylog_log_config (string):
# Default value: %%ETCDIR%%/server/log4j2.xml
# Path to the Graylog Server logfile
+#
+# graylog_java_home (path):
+# Default value: %%JAVA_HOME%%
+# Set it to the root of the JDK to use.
. /etc/rc.subr
@@ -63,6 +67,7 @@ load_rc_config $name
: ${graylog_logs_dir:="%%GRAYLOG_LOGS_DIR%%"}
: ${graylog_run_dir:="/var/run/graylog"}
: ${graylog_log_config:="%%ETCDIR%%/log4j2.xml"}
+: ${graylog_java_home:="%%JAVA_HOME%%"}
java_options=" \
-Djava.awt.headless=true \
@@ -103,6 +108,8 @@ command_args=" \
--no-pid-file \
--configfile ${graylog_config}"
+export JAVA_HOME=${graylog_java_home}
+
required_files="%%LOCALBASE%%/bin/java ${graylog_config}"
graylog_precmd() {