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
ES 1.0.2 debian package fails on removing dirs when purged #5770
Comments
Hey, what linux distribution did you try this on. The only call in question in the
Agreed, the |
It was install->uninstall on debian wheezy/sid (i installed 1.0.2 and realized I need older version so I purged it) "failed to remove directory '/var/lib'" only occurs when directory above (in my case /var/lib) is also a mount:
but that is basically a bug in rmdir, it should just return silently, instead:
and it's some old bug, as I see same behaviour on old centos 5 systems It works if directory exists but it will fail if it is a mounted partition. It will also fail if directory was already removed (like admin first removing mount ,then purging package). I think just ignoring exit code of rmdir should be fine. |
great explanation, thanks for digging into this.. so removing |
-p only works well when used with relative paths. If you want to clean up empty dirs,
works much better, but still exit code have to be handled/ignored |
The used -p option could result in accidentally deleting more directories than /var/lib/elasticsearch - so this option was removed Note: This only happens if the directories are empty, but still isnt needed. Relates elastic#5770
The used -p option could result in accidentally deleting more directories than /var/lib/elasticsearch - so this option was removed Note: This only happens if the directories are empty, but still isnt needed. Relates #5770
The used -p option could result in accidentally deleting more directories than /var/lib/elasticsearch - so this option was removed Note: This only happens if the directories are empty, but still isnt needed. Relates #5770
With #7078 merged does the issue still exist? |
@t-lo you are right, this should be fixed. Closing. |
Purging package doesn't work in any way:
When /var/lib/elasticsearch exists and is a directory, it tries to rmdir /var/lib
When /var/lib/elasticsearch doesn't exist, it tries to remove it and fails:
When /var/lib/elasticsearch is a mounted partition, it tries to remove dir and fails at it:
It also should probably do same stuff *DB packages do: ask if you want to keep your data when purging package
The text was updated successfully, but these errors were encountered: