as in summary update to 5.0.0 broke init script start up. version 2.4.1 (which shares same conf file and init script starts fine.) Reproducible: Always Steps to Reproduce: 1. emerge =app-misc/elasticsearch-5.0.0 2. rc-updte add elastcsearch default 3. rc 4. notice init script failure. Actual Results: oleg2 / # rc-update add elasticsearch default * service elasticsearch added to runlevel default oleg2 / # rc * Caching service dependencies ... [ ok ] * /etc/elasticsearch/logging.yml must be copied into place * ERROR: elasticsearch failed to start oleg2 / #
this might be connected to https://bugs.gentoo.org/show_bug.cgi?id=597454
The way how JVM options and logging are configured has completely changed with 5.x.
make sense, however version bumped without taking care about such possible changes.
Created attachment 453076 [details, diff] /etc/init.d/elasticsearch.patch - Elasticsearch 5.0.0 does not allows positional args anymore - Argument `-P {key}={val}` was renamed to `-E {key}={val}` and it's short form of `--{key}={val}` was eliminated - logging.yml is not used anymore, instead log4j config is used
Hm. Patch won't help -- i've screwed it a bit. will fix and readd
So the problem with patch is those positional args. I don't know how to make start-stop-daemon properly pass those. It will work if you will simply run (as elasticsearch): ``` PIDFILE="/run/elasticsearch/elasticsearch.pid" ES_BASE_PATH="/var/lib/elasticsearch/_default" CONF_DIR="/etc/elasticsearch" LOG_DIR="/var/log/elasticsearch/_default" ES_HOME="/usr/share/elasticsearch" DATA_DIR="${ES_BASE_PATH}/data" server_command="/usr/share/elasticsearch/bin/elasticsearch" server_args="-d -p ${PIDFILE} -E default.path.home=${ES_HOME} -E default.path.logs=${LOG_DIR} -E default.path.data=${DATA_DIR} -E default.path.conf=${CONF_DIR}" ${server_command} ${server_args} ``` Notice that prior elasticsearch `5.0.0` it was creating `elasticsearch/nodes` under `$DATA_DIR`, and now it's simply `nodes`, so user needs to do some migration manually.
I don't know what best option IS to solve this issue. elasticsearch binary does not supports positional args, thus all args should be passed before positional. To emphasize: ``` # this will work: elasticsearch -d -p ${PID_FILE} # this will not elasticsearch -- -d -p ${PID_FILE} ``` We probably can ship modified version of `/etc/elasticsearch/elasticsearch.yml` that will use ENV variables. Will provide a patch that shows this idea shortly.
Did not came up with any working patch. Sorry.
After continuous retries. I finally found what was wrong. `ES_GC_LOG_FILE` was deprecated and using it was causing ealsticsearch to show deprecation warning and stop. Please, see new proper patch to initscript that makes it actually work (tested)!
Created attachment 453174 [details, diff] PROPER /etc/init.d/elasticsearch.patch
Created attachment 453176 [details, diff] /etc/init.d/elasticsearch.patch
Can please look at this Patrick? I've just upgraded / fresh installed ES 5.0.1 and it fails to run.
`/usr/lib/systemd/system/elasticsearch.service` is also completely broken. I will try to patch it up using the `init.d` patches above.
Created attachment 456334 [details] elasticsearch.service changes were not difficult, modify PID_DIR to match what was defined in `tmpfiles.d` unit, and replace commandline -D with -E.
https://github.com/gentoo/gentoo/pull/3158
Please try 5.1.1.
(In reply to Leho Kraav (:macmaN @lkraav) from comment #14) > Created attachment 456334 [details] > elasticsearch.service > > changes were not difficult, modify PID_DIR to match what was defined in > `tmpfiles.d` unit, and replace commandline -D with -E. Let's continue fixing systemd in ES 5+ in https://bugs.gentoo.org/show_bug.cgi?id=597454. Can you please open a PR with the changes needed for 5.1.1 to make it work with systemd?
elasticsearch 5.5.2 init script still not working (with openrc)
(In reply to I am from comment #18) > elasticsearch 5.5.2 init script still not working (with openrc) Can you please be more specific? I believe it's some other issue, because this bug was closed in January and it targetted the differences between ES v2 and ES v5. Now we just bumped from v5.5.1 to v5.5.2 so it should not horribly break, besides I have it running on 2 systems so I cannot reproduce. Please provide some logs, configs, etc., thank you.