Bug 214572 - textproc/elasticsearch5: Problems starting service in a jail (probably on host too)
Summary: textproc/elasticsearch5: Problems starting service in a jail (probably on hos...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Tom Judge
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-16 14:33 UTC by purpleritza
Modified: 2016-12-03 02:53 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (tj)


Attachments
Makefile patch for textproc/elasticsearch5 (492 bytes, patch)
2016-12-02 02:19 UTC, redlamb19
no flags Details | Diff
Replacement patch file for bin/elasticsearch (541 bytes, patch)
2016-12-02 02:20 UTC, redlamb19
no flags Details | Diff
Replacement patch file for bin/elasticsearch.in.sh (1.27 KB, application/x-sh)
2016-12-02 02:21 UTC, redlamb19
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description purpleritza 2016-11-16 14:33:23 UTC
This is the log: http://pastebin.com/raw/WRzqaRJg

This is tested on new, clean 11.0-RELEASE jail.
Comment 1 purpleritza 2016-11-22 20:29:17 UTC
Any chance port can be updated to 5.0.1? Seems this issue I have with running ES5 in jail is resolved in latest build.

Thanks in advance.
Comment 2 redlamb19 2016-12-02 02:19:27 UTC
Created attachment 177584 [details]
Makefile patch for textproc/elasticsearch5

Updates Makefile to replace %%PREFIX%% within ${WRKSRC}/bin/elasticsearch.
Comment 3 redlamb19 2016-12-02 02:20:53 UTC
Created attachment 177585 [details]
Replacement patch file for bin/elasticsearch

Add patch file to PATCHDIR.
Comment 4 redlamb19 2016-12-02 02:21:45 UTC
Created attachment 177586 [details]
Replacement patch file for bin/elasticsearch.in.sh

Intended to replace current patch file for bin/elasticsearch.in.sh.
Comment 5 redlamb19 2016-12-02 02:27:39 UTC
I meant to add this comment prior to attaching the patch files. Sorry...

I've had similar problems with this port, but don't believe that upgrading to 5.0.1 (or 5.0.2) will solve the problem. Starting with version 5 of elastic, the method in which the JVM is configured was changed. Instead of setting various environment variables, e.g. ES_MIN_MEM, ES_MAX_MEM, etc, arguments are now expected to be specified within jvm.options or the ES_JAVA_OPTS. See here for more information:

https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_packaging.html#_jvm_options

Running 11.0-RELEASE

Fix: The attached Makefile patch and additional patch files modifies elasticsearch to read the default jvm.options file in ${PREFIX}/etc/elasticsearch and/or sets the appropriate ES_JAVA_OPTS variable based on the options set in /etc/rc.conf

# cd /usr/ports
# patch < elasticsearch5-Makefile.diff

# cp patch-* textproc/elasticsearch5/files
Comment 6 Tom Judge freebsd_committer freebsd_triage 2016-12-02 12:01:56 UTC
Fixed in the update to 5.0.2, thanks!
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-12-02 12:02:02 UTC
A commit references this bug:

Author: tj
Date: Fri Dec  2 12:01:13 UTC 2016
New revision: 427553
URL: https://svnweb.freebsd.org/changeset/ports/427553

Log:
  * Update to 5.0.2
  * Fix using jvm.options file
  * Add errors to rc script when using legacy rc.conf options

  PR:		214572, 214983
  Submitted by:	purpleritza@gmail.com
  Reported by:	purpleritza@gmail.com, Mark.Martinec@ijs.si

Changes:
  head/textproc/elasticsearch5/Makefile
  head/textproc/elasticsearch5/distinfo
  head/textproc/elasticsearch5/files/elasticsearch.in
  head/textproc/elasticsearch5/files/patch-bin_elasticsearch
  head/textproc/elasticsearch5/files/patch-bin_elasticsearch.in.sh
  head/textproc/elasticsearch5/files/patch-config_elasticsearch.yml
  head/textproc/elasticsearch5/pkg-plist
Comment 8 redlamb19 2016-12-03 02:53:23 UTC
It looks like one of the attachments wasn't committed in the update. The "Replacement patch for bin/elasticsearch.in.sh" (1.27KB) should replace the existing patch file named "patch-bin_elastisearch.in.sh". Without the changes referenced in this post-patch file, elasticsearch options set in /etc/rc.conf, e.g. elasticsearch_min_mem, elasticsearch_max_mem, etc, won't take effect and will set environment variables that are no longer supported by elasticsearch's startup scripts.