OpenSearch/distribution
William Brafford b7291573b2
Always set default ES_PATH_CONF for package scriptlets (#51827) (#52381)
* Set default ES_PATH_CONF for package scriptlets

Our packages use scriptlets to create or update the Elasticsearch
keystore as necessary when installing or upgrading an Elasticsearch
package. If these scriptlets don't work as expected, Elasticsearch may
try and fail to create or upgrade the keystore at startup time. This
will prevent Elasticsearch from starting up at all.

These scriptlets use the Elasticsearch keystore command-line tools. Like
most of our command-line tools, the keystore tools will by default get
their value for ES_PATH_CONF from a system configuration file:
/etc/sysconfig/elasticsearch for RPMs, /etc/default/elasticsearch for
debian packages. Previously, if the user removed ES_PATH_CONF from that
system configuration file (perhaps thinking that it is obsolete when
the same variables is also defined in the systemd unit file), the
keystore command-line tools would fail. Scriptlet errors do not seem to
cause the installation to fail, and for RPMs the error message is easy
to miss in command output.

This commit adds a line of bash to scriptlets that will set ES_PATH_CONF
to a default when ES_PATH_CONF is unset, rather than only when the
system configuration file is missing.
2020-02-14 16:00:13 -05:00
..
archives Introduce jvm.options.d for customizing JVM options (#51882) 2020-02-08 18:50:14 -05:00
bwc Tag "nested" Gradle build scans (#51440) 2020-01-24 11:23:23 -08:00
docker Remove setuid,setgid bits on all files in Docker image (#51851) 2020-02-13 13:18:13 +01:00
licenses Add notice for bundled jdk (#40576) 2019-03-29 17:21:21 -04:00
packages Always set default ES_PATH_CONF for package scriptlets (#51827) (#52381) 2020-02-14 16:00:13 -05:00
src Remove unnecessary dirname command (#51968) (#52089) 2020-02-10 11:05:36 -05:00
tools Add unit tests for reading JVM options files (#52176) 2020-02-11 21:02:34 -05:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00