Remove NOREPLACE for /etc/elasticsearch in rpm and deb (#37839)
The /etc/elasticsearch directory is currently configured as a config file with noreplace. However, the directory itself is not config, and can lead to an entire /etc/elasticsearch.rpmsave directory in some situations. This commit fixes the ospackage config to not specify those file bits for the directory itself, but only the files underneath it.
This commit is contained in:
parent
acc3cae40c
commit
e88ae99340
|
@ -83,6 +83,9 @@ void addProcessFilesTask(String type, boolean oss) {
|
|||
mkdir "${packagingFiles}/var/log/elasticsearch"
|
||||
mkdir "${packagingFiles}/var/lib/elasticsearch"
|
||||
mkdir "${packagingFiles}/usr/share/elasticsearch/plugins"
|
||||
|
||||
// bare empty dir for /etc/elasticsearch
|
||||
mkdir "${packagingFiles}/elasticsearch"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,14 +176,22 @@ Closure commonPackageConfig(String type, boolean oss) {
|
|||
configurationFile '/etc/elasticsearch/users'
|
||||
configurationFile '/etc/elasticsearch/users_roles'
|
||||
}
|
||||
into('/etc') {
|
||||
from("${packagingFiles}") {
|
||||
dirMode 02750
|
||||
into('/etc')
|
||||
permissionGroup 'elasticsearch'
|
||||
includeEmptyDirs true
|
||||
createDirectoryEntry true
|
||||
include("elasticsearch") // empty dir, just to add directory entry
|
||||
}
|
||||
from("${packagingFiles}/etc/elasticsearch") {
|
||||
into('/etc/elasticsearch')
|
||||
dirMode 02750
|
||||
fileMode 0660
|
||||
permissionGroup 'elasticsearch'
|
||||
includeEmptyDirs true
|
||||
createDirectoryEntry true
|
||||
fileType CONFIG | NOREPLACE
|
||||
from "${packagingFiles}/etc"
|
||||
}
|
||||
String envFile = expansionsForDistribution(type, false)['path.env']
|
||||
configurationFile envFile
|
||||
|
|
Loading…
Reference in New Issue