-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Always set default ES_PATH_CONF for package scriptlets #51827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
williamrandolph
merged 6 commits into
elastic:master
from
williamrandolph:package-default-conf-dir
Feb 14, 2020
Merged
Always set default ES_PATH_CONF for package scriptlets #51827
williamrandolph
merged 6 commits into
elastic:master
from
williamrandolph:package-default-conf-dir
Feb 14, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Pinging @elastic/es-core-infra (:Core/Infra/Packaging) |
Judging by the CI failure, I think you may need to bring your branch up-to-date due to #51714. |
rjernst
approved these changes
Feb 10, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
williamrandolph
added a commit
to williamrandolph/elasticsearch
that referenced
this pull request
Feb 14, 2020
* 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.
williamrandolph
added a commit
that referenced
this pull request
Feb 14, 2020
* 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.
h0tw1r3
added a commit
to btolab/puppet-elasticsearch
that referenced
this pull request
Jun 19, 2021
fixed upstream in elasticsearch 7 elastic/elasticsearch#51827
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Delivery/Packaging
RPM and deb packaging, tar and zip archives, shell and batch scripts
Team:Delivery
Meta label for Delivery team
v7.7.0
v8.0.0-alpha1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 PR adds adjusts the scriptlets to set ES_PATH_CONF to a default value whenever ES_PATH_CONF is unset, rather than only when the system configuration file is missing.
Fixes #50631
Relates #50246
Note: the bash construct I'm using here is default values for parameter expansion. From the manpage: