mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 12:56:53 +00:00
[Packaging] Do not remove scripts directory on upgrade (#20452)
When upgrading elasticsearch using the RPM package, the scripts directory is removed if it's empty but it won't be recreated by the upgraded package. But after that the service won't start because the scripts dir is missing.
This commit is contained in:
parent
89640965d2
commit
26dc6f1306
@ -79,12 +79,13 @@ if [ "$REMOVE_SERVICE" = "true" ]; then
|
||||
if command -v update-rc.d >/dev/null; then
|
||||
update-rc.d elasticsearch remove >/dev/null || true
|
||||
fi
|
||||
|
||||
SCRIPTS_DIR="/etc/elasticsearch/scripts"
|
||||
# delete the scripts directory if and only if empty
|
||||
if [ -d "$SCRIPTS_DIR" ]; then
|
||||
rmdir --ignore-fail-on-non-empty "$SCRIPTS_DIR"
|
||||
fi
|
||||
fi
|
||||
|
||||
SCRIPTS_DIR="/etc/elasticsearch/scripts"
|
||||
# delete the scripts directory if and only if empty
|
||||
if [ -d "$SCRIPTS_DIR" ]; then
|
||||
rmdir --ignore-fail-on-non-empty "$SCRIPTS_DIR"
|
||||
fi
|
||||
|
||||
${scripts.footer}
|
||||
|
@ -131,6 +131,7 @@ setup() {
|
||||
|
||||
# The configuration files are still here
|
||||
assert_file_exist "/etc/elasticsearch"
|
||||
assert_file_exist "/etc/elasticsearch/scripts"
|
||||
assert_file_exist "/etc/elasticsearch/elasticsearch.yml"
|
||||
assert_file_exist "/etc/elasticsearch/jvm.options"
|
||||
assert_file_exist "/etc/elasticsearch/log4j2.properties"
|
||||
@ -152,6 +153,7 @@ setup() {
|
||||
@test "[DEB] verify package purge" {
|
||||
# all remaining files are deleted by the purge
|
||||
assert_file_not_exist "/etc/elasticsearch"
|
||||
assert_file_not_exist "/etc/elasticsearch/scripts"
|
||||
assert_file_not_exist "/etc/elasticsearch/elasticsearch.yml"
|
||||
assert_file_not_exist "/etc/elasticsearch/jvm.options"
|
||||
assert_file_not_exist "/etc/elasticsearch/log4j2.properties"
|
||||
|
@ -119,6 +119,7 @@ setup() {
|
||||
assert_file_not_exist "/var/run/elasticsearch"
|
||||
|
||||
assert_file_not_exist "/etc/elasticsearch"
|
||||
assert_file_not_exist "/etc/elasticsearch/scripts"
|
||||
assert_file_not_exist "/etc/elasticsearch/elasticsearch.yml"
|
||||
assert_file_not_exist "/etc/elasticsearch/jvm.options"
|
||||
assert_file_not_exist "/etc/elasticsearch/log4j2.properties"
|
||||
|
Loading…
x
Reference in New Issue
Block a user