aboutsummaryrefslogtreecommitdiffstats
path: root/textproc
diff options
context:
space:
mode:
authorfeld <feld@FreeBSD.org>2018-03-02 07:37:20 +0800
committerfeld <feld@FreeBSD.org>2018-03-02 07:37:20 +0800
commitb9e25fb314010b522152ba161861e1f44af09eef (patch)
tree690d42e9e53473a470ab1a902cb6d6cd9bf9e7e1 /textproc
parentbb72a6053f67dd3d4c6ad52043c29c2af3006cc1 (diff)
downloadfreebsd-ports-gnome-b9e25fb314010b522152ba161861e1f44af09eef.tar.gz
freebsd-ports-gnome-b9e25fb314010b522152ba161861e1f44af09eef.tar.zst
freebsd-ports-gnome-b9e25fb314010b522152ba161861e1f44af09eef.zip
textproc/elasticsearch6: Fix run issues
- Elastic no longer accepts -Epath.conf argument. Change to ES_PATH_CONF env - Elastic was not honoring the elasticsearch_tmpdir rc.conf variable. Remove. The default behavior is to use mktemp for a unique tmpdir in /tmp. This seems sane, especially when running multiple profiles. - Patch jvm.options to set a writable location for gc.log, which will be the tmpdir. There is not an easy way to automatically point this to the log dir, so it needs a unique location when running muliple profiles. - devel/jca is also a BUILD dependency to fix build outside poudriere PR: 226265
Diffstat (limited to 'textproc')
-rw-r--r--textproc/elasticsearch6/Makefile9
-rw-r--r--textproc/elasticsearch6/files/elasticsearch.in15
-rw-r--r--textproc/elasticsearch6/files/patch-config_elasticsearch.yml12
-rw-r--r--textproc/elasticsearch6/files/patch-config_jvm.options11
4 files changed, 29 insertions, 18 deletions
diff --git a/textproc/elasticsearch6/Makefile b/textproc/elasticsearch6/Makefile
index 9242453e64f0..298aa59914e5 100644
--- a/textproc/elasticsearch6/Makefile
+++ b/textproc/elasticsearch6/Makefile
@@ -3,7 +3,7 @@
PORTNAME= elasticsearch
PORTVERSION= 6.2.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= textproc java devel
MASTER_SITES= https://artifacts.elastic.co/downloads/${PORTNAME}/ \
http://mirrors.rit.edu/zi/
@@ -14,6 +14,7 @@ COMMENT= Full-text search engine for Java
LICENSE= APACHE20
+BUILD_DEPENDS= jna>0:devel/jna
RUN_DEPENDS= bash>0:shells/bash \
jna>0:devel/jna
@@ -25,8 +26,9 @@ USE_JAVA= yes
NO_BUILD= yes
JAVA_VERSION= 1.8+
USE_RC_SUBR= ${PORTNAME}
-SHEBANG_FILES= bin/elasticsearch-plugin \
- bin/elasticsearch
+SHEBANG_FILES= bin/elasticsearch \
+ bin/elasticsearch-env \
+ bin/elasticsearch-plugin
OPTIONS_DEFINE= DOCS
@@ -34,6 +36,7 @@ OPTIONS_DEFINE= DOCS
CONFIG_FILES= elasticsearch.yml log4j2.properties jvm.options
BINS= elasticsearch \
+ elasticsearch-env \
elasticsearch-plugin
PORTDOCS= LICENSE.txt \
diff --git a/textproc/elasticsearch6/files/elasticsearch.in b/textproc/elasticsearch6/files/elasticsearch.in
index d394d9c764f1..54ad8138ad5d 100644
--- a/textproc/elasticsearch6/files/elasticsearch.in
+++ b/textproc/elasticsearch6/files/elasticsearch.in
@@ -17,8 +17,6 @@
# Set it to required group.
# elasticsearch_config (path): Set to %%PREFIX%%/etc/elasticsearch/elasticsearch.yml by default.
# Set it to the config file location.
-# elasticsearch_tmp (path): Set to /var/tmp/elasticsearch by default.
-# Set it to the path to be used for temp files.
#
. /etc/rc.subr
@@ -31,7 +29,6 @@ load_rc_config ${name}
: ${elasticsearch_user=elasticsearch}
: ${elasticsearch_group=elasticsearch}
: ${elasticsearch_config=%%PREFIX%%/etc/elasticsearch}
-: ${elasticsearch_tmp=/var/tmp/elasticsearch}
required_files="${elasticsearch_config}/elasticsearch.yml"
_pidprefix=/var/run/elasticsearch
@@ -42,12 +39,13 @@ extra_commands="console status"
console_cmd=elasticsearch_console
start_precmd=elasticsearch_precmd
command=%%PREFIX%%/lib/elasticsearch/bin/elasticsearch
-command_args="-d --pidfile=${pidfile} -Epath.conf=${elasticsearch_config}"
+command_args="-d --pidfile=${pidfile}"
+
+export ES_PATH_CONF=${elasticsearch_config}
elasticsearch_precmd()
{
/usr/bin/install -o ${elasticsearch_user} -g ${elasticsearch_group} /dev/null ${pidfile}
- /usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 755 ${elasticsearch_tmp}
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 755 /var/db/elasticsearch
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 755 /var/log/elasticsearch
}
@@ -66,15 +64,12 @@ if [ -n "$2" ]; then
echo "You must define a configuration (elasticsearch_${profile}_config)"
exit 1
fi
+ export ES_PATH_CONF=${elasticsearch_config}
required_files="${elasticsearch_config}/elasticsearch.yml"
required_files="${elasticsearch_config}/jvm.options"
eval elasticsearch_enable="\${elasticsearch_${profile}_enable:-${elasticsearch_enable}}"
- eval elasticsearch_tmp="\${elasticsearch_${profile}_args:-${elasticsearch_tmp}}"
pidfile="${_pidprefix}.${profile}.pid"
- if [ -e ${elasticsearch_config}/jvm.options ]; then
- export ES_JVM_OPTIONS=${elasticsearch_config}/jvm.options
- fi
- command_args="-d --pidfile=${pidfile} -Epath.conf=${elasticsearch_config}"
+ command_args="-d --pidfile=${pidfile}"
echo "===> elasticsearch profile: ${profile}"
else
echo "$0: extra argument ignored"
diff --git a/textproc/elasticsearch6/files/patch-config_elasticsearch.yml b/textproc/elasticsearch6/files/patch-config_elasticsearch.yml
index d44fa1d5a675..f61a04c32b9a 100644
--- a/textproc/elasticsearch6/files/patch-config_elasticsearch.yml
+++ b/textproc/elasticsearch6/files/patch-config_elasticsearch.yml
@@ -1,13 +1,15 @@
---- config/elasticsearch.yml.orig 2018-02-06 00:13:22 UTC
+--- config/elasticsearch.yml.orig 2018-02-16 18:57:55 UTC
+++ config/elasticsearch.yml
-@@ -35,6 +35,10 @@
+@@ -31,10 +31,12 @@
+ # Path to directory where to store the data (separate multiple locations by comma):
+ #
+ #path.data: /path/to/data
++path.data: /var/db/elasticsearch
+ #
# Path to log files:
#
#path.logs: /path/to/logs
+path.logs: /var/log/elasticsearch
-+#
-+# Path to scripts dir:
-+path.scripts: /usr/local/libexec/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
diff --git a/textproc/elasticsearch6/files/patch-config_jvm.options b/textproc/elasticsearch6/files/patch-config_jvm.options
new file mode 100644
index 000000000000..3e259c0b1315
--- /dev/null
+++ b/textproc/elasticsearch6/files/patch-config_jvm.options
@@ -0,0 +1,11 @@
+--- config/jvm.options.orig 2018-03-01 23:04:45 UTC
++++ config/jvm.options
+@@ -87,7 +87,7 @@
+ 8:-XX:+PrintGCDateStamps
+ 8:-XX:+PrintTenuringDistribution
+ 8:-XX:+PrintGCApplicationStoppedTime
+-8:-Xloggc:logs/gc.log
++8:-Xloggc:${ES_TMPDIR}/gc.log
+ 8:-XX:+UseGCLogFileRotation
+ 8:-XX:NumberOfGCLogFiles=32
+ 8:-XX:GCLogFileSize=64m