-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Package] Remove bin/lib/modules directories on RPM uninstall/upgrade #20448
Conversation
@@ -76,6 +77,12 @@ if [ "$REMOVE_DIRS" = "true" ]; then | |||
echo " OK" | |||
fi | |||
|
|||
if [ -d "$MODULES_DIR" ]; then |
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.
I feel like we should be able to mark the directory in the same way that we mark the lib
and rpm/deb should handle that for us?
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.
I agree - I just don't know how to do with nebula.ospackage. Also, it seems that the current configuration leaves empty directory around like /usr/share/elasticsearch/bin
, /usr/share/elasticsearch/lib
or /usr/share/elasticsearch/modules
.
In the case of modules and if empty directories remains on the filesystem, the plugin service will fail to find plugin descriptor in empty directories like /usr/share/elasticsearch/modules/deprecated-plugin
...
That's why I chose this option.
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.
Ok - it isn't great but lets go with it.
LGTM |
79636f4
to
ccad888
Compare
@nik9000 Thanks for your review! I spent some time trying to figure a better solution using ospackage. It's still a kind of hacky but can you please tell me what you think of it? |
Also, it registers the bin, lib, modules and each module directory in the RPM spec so that they are correctly removed (like it was for 2.x rpms). |
Much better! LGTM |
…elastic#20448) When uninstalling or upgrading elasticsearch using the RPM package some empty directories remain on the filesystem: /usr/share/elasticsearch/bin /usr/share/elasticsearch/lib /usr/share/elasticsearch/modules /usr/share/elasticsearch/modules/foo Having empty directories in modules can prevent elasticsearch to start after an upgrade: the plugins service expects to find a plugin-descriptor.properties file in every sub directory of modules. This PR cleans things a bit so that these empty directories are removed on upgrade/removal like it was in 2.x.
ccad888
to
3caaafa
Compare
…#20448) When uninstalling or upgrading elasticsearch using the RPM package some empty directories remain on the filesystem: /usr/share/elasticsearch/bin /usr/share/elasticsearch/lib /usr/share/elasticsearch/modules /usr/share/elasticsearch/modules/foo Having empty directories in modules can prevent elasticsearch to start after an upgrade: the plugins service expects to find a plugin-descriptor.properties file in every sub directory of modules. This PR cleans things a bit so that these empty directories are removed on upgrade/removal like it was in 2.x. (cherry picked from commit 3caaafa)
…#20448) When uninstalling or upgrading elasticsearch using the RPM package some empty directories remain on the filesystem: /usr/share/elasticsearch/bin /usr/share/elasticsearch/lib /usr/share/elasticsearch/modules /usr/share/elasticsearch/modules/foo Having empty directories in modules can prevent elasticsearch to start after an upgrade: the plugins service expects to find a plugin-descriptor.properties file in every sub directory of modules. This PR cleans things a bit so that these empty directories are removed on upgrade/removal like it was in 2.x. (cherry picked from commit 3caaafa)
Thanks @nik9000! I merged and updated the description of the PR to better reflect the changes. |
When uninstalling or upgrading elasticsearch using the RPM package some empty directories remain on the filesystem:
Having empty directories in
modules
can prevent elasticsearch to start after an upgrade: the plugins service expects to find aplugin-descriptor.properties
file in every sub directory ofmodules
.This PR cleans things a bit so that these empty directories are removed on upgrade/removal like it was in 2.x.