Sockets and cgroups have different lifetimes (e.g. fd passing between
cgroups) so obtaining a cgroup id to a removed cgroup dir is not an
error. Furthermore, the message is printed for each such a socket (which
is redundant each such socket's cgroup is shown as 'unreachable').
Improve user experience by silencing these specific errors.
Signed-off-by: Michal Koutný <mkoutny@suse.com>
fd = open_by_handle_at(mnt_fd, fhp, 0);
if (fd < 0) {
- fprintf(stderr, "Failed to open cgroup2 by ID\n");
+ if (errno != ESTALE)
+ fprintf(stderr, "Failed to open cgroup2 by ID\n");
goto out;
}