diff options
author | Valerij Fredriksen <valerijf@yahooinc.com> | 2022-05-06 10:56:05 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@yahooinc.com> | 2022-05-06 11:05:06 +0200 |
commit | ce90e0cbb5928c51a77a01dd134a3a792f26aebb (patch) | |
tree | eb72d73c58d7659b089cdf9edf9cb8c13b8fc304 /node-admin | |
parent | 1ab9e6408dccb85ce3d0c845876ba5a68d6eeb0d (diff) |
Set correct user on container crash path
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/coredump/CoredumpHandler.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/coredump/CoredumpHandler.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/coredump/CoredumpHandler.java index 2271991fa15..ab4c993bab9 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/coredump/CoredumpHandler.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/coredump/CoredumpHandler.java @@ -9,6 +9,7 @@ import com.yahoo.vespa.hosted.node.admin.nodeadmin.ConvergenceException; import com.yahoo.vespa.hosted.node.admin.nodeagent.NodeAgentContext; import com.yahoo.vespa.hosted.node.admin.task.util.file.FileFinder; import com.yahoo.vespa.hosted.node.admin.task.util.file.UnixPath; +import com.yahoo.vespa.hosted.node.admin.task.util.file.UnixUser; import com.yahoo.vespa.hosted.node.admin.task.util.fs.ContainerPath; import com.yahoo.vespa.hosted.node.admin.task.util.process.Terminal; @@ -84,9 +85,15 @@ public class CoredumpHandler { public void converge(NodeAgentContext context, Supplier<Map<String, Object>> nodeAttributesSupplier, boolean throwIfCoreBeingWritten) { - ContainerPath containerCrashPath = context.paths().of(crashPatchInContainer); + ContainerPath containerCrashPath = context.paths().of(crashPatchInContainer, context.users().vespa()); ContainerPath containerProcessingPath = containerCrashPath.resolve(PROCESSING_DIRECTORY_NAME); + // TODO (freva): Remove after 7.584 + UnixUser vespaUser = context.users().vespa(); + UnixPath processingPath = new UnixPath(containerProcessingPath); + if (processingPath.getOwnerId() != vespaUser.uid()) processingPath.setOwnerId(vespaUser.uid()); + if (processingPath.getGroupId() != vespaUser.gid()) processingPath.setGroupId(vespaUser.gid()); + updateMetrics(context, containerCrashPath); if (throwIfCoreBeingWritten) { |