udevd: suppress warning if we don't find cgroup
authorTom Gundersen <teg@jklm.no>
Mon, 22 Jun 2015 14:53:54 +0000 (16:53 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 22 Jun 2015 14:55:49 +0000 (16:55 +0200)
This is expected on non-systemd systems, so just log it at debug level.

This fixes issue #309.

src/udev/udevd.c

index c205f1d..ff15664 100644 (file)
@@ -1672,8 +1672,12 @@ int main(int argc, char *argv[]) {
                    we only do this on systemd systems, and only if we are directly spawned
                    by PID1. otherwise we are not guaranteed to have a dedicated cgroup */
                 r = cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, 0, &cgroup);
-                if (r < 0)
-                        log_warning_errno(r, "failed to get cgroup: %m");
+                if (r < 0) {
+                        if (r == -ENOENT)
+                                log_debug_errno(r, "did not find dedicated cgroup: %m");
+                        else
+                                log_warning_errno(r, "failed to get cgroup: %m");
+                }
         }
 
         r = listen_fds(&fd_ctrl, &fd_uevent);