[systemd-devel] [PATCH] core: don't complain if cgroup property is missing

Umut Tezduyar Lindskog umut.tezduyar at axis.com
Tue Jul 15 02:53:03 PDT 2014


---
 src/core/cgroup.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index cd67963..ed5687d 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -303,12 +303,12 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
                         state == MANAGER_STARTING && c->startup_cpu_shares != (unsigned long) -1 ? c->startup_cpu_shares :
                         c->cpu_shares != (unsigned long) -1 ? c->cpu_shares : 1024);
                 r = cg_set_attribute("cpu", path, "cpu.shares", buf);
-                if (r < 0)
+                if (r < 0 && r != -EACCES)
                         log_warning("Failed to set cpu.shares on %s: %s", path, strerror(-r));
 
                 sprintf(buf, USEC_FMT "\n", CGROUP_CPU_QUOTA_PERIOD_USEC);
                 r = cg_set_attribute("cpu", path, "cpu.cfs_period_us", buf);
-                if (r < 0)
+                if (r < 0 && r != -EACCES)
                         log_warning("Failed to set cpu.cfs_period_us on %s: %s", path, strerror(-r));
 
                 if (c->cpu_quota_per_sec_usec != (usec_t) -1) {
@@ -316,7 +316,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
                         r = cg_set_attribute("cpu", path, "cpu.cfs_quota_us", buf);
                 } else
                         r = cg_set_attribute("cpu", path, "cpu.cfs_quota_us", "-1");
-                if (r < 0)
+                if (r < 0 && r != -EACCES)
                         log_warning("Failed to set cpu.cfs_quota_us on %s: %s", path, strerror(-r));
         }
 
-- 
1.7.10.4



More information about the systemd-devel mailing list