Bug 226301 - textproc/elasticsearch6: elasticsearch/config: No such file or directory
Summary: textproc/elasticsearch6: elasticsearch/config: No such file or directory
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-02 17:09 UTC by ivo
Modified: 2018-03-14 19:30 UTC (History)
3 users (show)

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


Attachments
elasticsearch-plugin wrapper (338 bytes, application/x-shellscript)
2018-03-03 02:38 UTC, redlamb19
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ivo 2018-03-02 17:09:20 UTC
When I run /usr/local/lib/elasticsearch/bin/elasticsearch-plugin
I get the message: /usr/local/lib/elasticsearch/bin/elasticsearch-env: line 78: cd: /usr/local/lib/elasticsearch/config: No such file or directory

This can be fixed by adding the symbolic link /usr/local/lib/elasticsearch/config pointing to /usr/local/etc/elasticsearch but there should be a better fix.

Another problem occurs when you execute elasticsearch-plugin from a different path, it will execute /usr/local/bin/elasticsearch-plugin and that gives the error:
/usr/local/bin/elasticsearch-plugin: line 3: /usr/local/bin/elasticsearch-env: No such file or directory
/usr/local/bin/elasticsearch-plugin: line 6: exec: : not found
Comment 1 redlamb19 2018-03-03 02:36:50 UTC
Much like what we previously saw with the elasticsearch rc script, this is a result of ES_PATH_CONF not being set prior to the execution of elasticsearch-plugin.

Not sure if this is the best approach, but it's an idea that doesn't require modifying the stock elasticsearch-plugin script. Instead of creating the symlink to /usr/local/bin, install a wrapper script that honors the rc.conf variables and sets ES_PATH_CONF before handing execution off to the real elasticsearch-plugin.
Comment 2 redlamb19 2018-03-03 02:38:31 UTC
Created attachment 191161 [details]
elasticsearch-plugin wrapper

simple wrapper that reads rc.conf variables and properly sets ES_PATH_CONF before handing control over to the stock elasticsearch-plugin script.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-03-14 19:18:45 UTC
A commit references this bug:

Author: feld
Date: Wed Mar 14 19:17:59 UTC 2018
New revision: 464526
URL: https://svnweb.freebsd.org/changeset/ports/464526

Log:
  textproc/elasticsearch6: Fix ability to install plugins

  - Update pkg-message to provide very useful info
  - Use login_class=root by default to help users avoid this issue (affects everyone)

  PR:		226301

Changes:
  head/textproc/elasticsearch6/Makefile
  head/textproc/elasticsearch6/files/elasticsearch.in
  head/textproc/elasticsearch6/files/pkg-message.in
Comment 4 Mark Felder freebsd_committer freebsd_triage 2018-03-14 19:30:16 UTC
This should be fixed now. It's not as flexible as we would like, but it seems that even upstream doesn't allow this to be flexible on Linux either.