Skip to content

Commit

Permalink
Rework gid setting
Browse files Browse the repository at this point in the history
  • Loading branch information
breskeby committed Oct 30, 2024
1 parent 8b9155a commit aa5ccb0
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 7 deletions.
14 changes: 7 additions & 7 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def commonPackageConfig(String type, String architecture) {
configurationFile '/etc/elasticsearch/users_roles'
from("${packagingFiles}") {
dirPermissions {
unix(02750)
unix(0750)
}
into('/etc')
permissionGroup 'elasticsearch'
Expand All @@ -209,7 +209,7 @@ def commonPackageConfig(String type, String architecture) {
from("${packagingFiles}/etc/elasticsearch") {
into('/etc/elasticsearch')
dirPermissions {
unix(02750)
unix(0750)
}
setgid = true
filePermissions {
Expand Down Expand Up @@ -261,7 +261,7 @@ def commonPackageConfig(String type, String architecture) {

// ========= empty dirs =========
// NOTE: these are created under packagingFiles as empty, but the permissions are set here
Closure copyEmptyDir = { path, u, g, mode ->
Closure copyEmptyDir = { path, u, g, gid, mode ->
File file = new File(path)
into(file.parent) {
from "${packagingFiles}/${file.parent}"
Expand All @@ -273,12 +273,12 @@ def commonPackageConfig(String type, String architecture) {
dirPermissions {
unix(mode)
}
setgid (mode == 02750)
setgid(gid)
}
}
copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', 02750)
copyEmptyDir('/var/lib/elasticsearch', 'elasticsearch', 'elasticsearch', 02750)
copyEmptyDir('/usr/share/elasticsearch/plugins', 'root', 'root', 0755)
copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', true, 0750)
copyEmptyDir('/var/lib/elasticsearch', 'elasticsearch', 'elasticsearch', true, 0750)
copyEmptyDir('/usr/share/elasticsearch/plugins', 'root', 'root', true, 0755)

// the oss package conflicts with the default distribution and vice versa
conflicts('elasticsearch-oss')
Expand Down
Loading

0 comments on commit aa5ccb0

Please sign in to comment.