Skip to content
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

Merged
merged 1 commit into from
Sep 14, 2016

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Sep 13, 2016

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.

@tlrx tlrx added review :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v6.0.0-alpha1 v5.1.1 v5.0.0-beta1 labels Sep 13, 2016
@@ -76,6 +77,12 @@ if [ "$REMOVE_DIRS" = "true" ]; then
echo " OK"
fi

if [ -d "$MODULES_DIR" ]; then
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

@nik9000
Copy link
Member

nik9000 commented Sep 13, 2016

LGTM

@tlrx tlrx force-pushed the remove-modules-dir branch 2 times, most recently from 79636f4 to ccad888 Compare September 14, 2016 13:56
@tlrx
Copy link
Member Author

tlrx commented Sep 14, 2016

@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?

@tlrx
Copy link
Member Author

tlrx commented Sep 14, 2016

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).

@nik9000
Copy link
Member

nik9000 commented Sep 14, 2016

Much better! LGTM

@clintongormley clintongormley changed the title [Package] Remove modules directories on uninstall/upgrade Remove modules directories on uninstall/upgrade Sep 14, 2016
@tlrx tlrx changed the title Remove modules directories on uninstall/upgrade [Package] Remove bin/lib/modules directories on RPM uninstall/upgrade Sep 14, 2016
…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.
@tlrx tlrx merged commit 3caaafa into elastic:master Sep 14, 2016
@tlrx tlrx removed the review label Sep 14, 2016
tlrx added a commit that referenced this pull request Sep 14, 2016
…#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)
tlrx added a commit that referenced this pull request Sep 14, 2016
…#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)
@tlrx
Copy link
Member Author

tlrx commented Sep 14, 2016

Thanks @nik9000! I merged and updated the description of the PR to better reflect the changes.

@tlrx tlrx deleted the remove-modules-dir branch September 14, 2016 16:22
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
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 v5.0.0-beta1 v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants