You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2025/01/08 03:33:07 UTC

(cloudberry) 02/16: add permission check to file /sys/fs/cgroup/cgroup.procs (#15133)

This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 4c15d6b333a6ec3bcd70ab5e6d5111e5d0931eaa
Author: Zhenglong Li <lz...@vmware.com>
AuthorDate: Wed Mar 8 08:46:24 2023 +0800

    add permission check to file /sys/fs/cgroup/cgroup.procs (#15133)
    
    Add permission check to file /sys/fs/cgroup/cgroup.procs.
    
    Make sure gpstart -rai will definitely succeed if the customer uses gpconfig to set the
    gp_resource_manager to group-v2.
---
 gpMgmt/bin/gpcheckresgroupv2impl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gpMgmt/bin/gpcheckresgroupv2impl b/gpMgmt/bin/gpcheckresgroupv2impl
index 4a0fbe42a0..e08798c34b 100755
--- a/gpMgmt/bin/gpcheckresgroupv2impl
+++ b/gpMgmt/bin/gpcheckresgroupv2impl
@@ -25,7 +25,7 @@ class CgroupValidation(object):
         return ""
 
 
-class CgroupValidationVersionBeta(CgroupValidation):
+class CgroupValidationVersionTwo(CgroupValidation):
     def __init__(self):
         self.mount_point = self.detect_cgroup_mount_point()
         self.tab = {"r": os.R_OK, "w": os.W_OK, "x": os.X_OK, "f": os.F_OK}
@@ -41,6 +41,8 @@ class CgroupValidationVersionBeta(CgroupValidation):
         if not self.mount_point:
             self.die("failed to detect cgroup v2 mount point.")
 
+        self.validate_permission("cgroup.procs", "rw")
+
         self.validate_permission("gpdb/", "rwx")
         self.validate_permission("gpdb/cgroup.procs", "rw")
 
@@ -85,6 +87,6 @@ class CgroupValidationVersionBeta(CgroupValidation):
 
 if __name__ == '__main__':
     try:
-        CgroupValidationVersionBeta().validate_all()
+        CgroupValidationVersionTwo().validate_all()
     except ValidationException as e:
         exit(e.message)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org