chiark / gitweb /
cgroup-util: downgrade log messages from library code to LOG_DEBUG
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 17:57:07 +0000 (19:57 +0200)
committerSven Eden <yamakuzure@gmx.net>
Mon, 25 Sep 2017 12:40:15 +0000 (14:40 +0200)
These errors don't really matter, that's why we log and proceed in the
current code. However, we currently log at LOG_WARNING, but we really
shouldn't given that this is library code. Hence downgrade this to
LOG_DEBUG.

src/basic/cgroup-util.c

index 6b3816437e41b6f02049a22c69a24a6c62de47e6..5fc59d2ef43676fe1122557737270e58ef13672a 100644 (file)
@@ -909,7 +909,7 @@ int cg_set_group_access(
         if (r > 0 && streq(controller, SYSTEMD_CGROUP_CONTROLLER)) {
                 r = cg_set_group_access(SYSTEMD_CGROUP_CONTROLLER_LEGACY, path, mode, uid, gid);
                 if (r < 0)
-                        log_warning_errno(r, "Failed to set group access on compat systemd cgroup %s: %m", path);
+                        log_debug_errno(r, "Failed to set group access on compatibility systemd cgroup %s, ignoring: %m", path);
         }
 
         return 0;
@@ -955,9 +955,11 @@ int cg_set_task_access(
         if (r < 0)
                 return r;
         if (r > 0 && streq(controller, SYSTEMD_CGROUP_CONTROLLER)) {
+                /* Always propagate access mode from unified to legacy controller */
+
                 r = cg_set_task_access(SYSTEMD_CGROUP_CONTROLLER_LEGACY, path, mode, uid, gid);
                 if (r < 0)
-                        log_warning_errno(r, "Failed to set task access on compat systemd cgroup %s: %m", path);
+                        log_debug_errno(r, "Failed to set task access on compatibility systemd cgroup %s, ignoring: %m", path);
         }
 
         return 0;
@@ -1004,7 +1006,7 @@ int cg_get_xattr(const char *controller, const char *path, const char *name, voi
 int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
         _cleanup_fclose_ FILE *f = NULL;
         char line[LINE_MAX];
-        const char *fs, *controller_str = NULL;
+        const char *fs, *controller_str;
         size_t cs = 0;
         int unified;