mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Another case for when we need to silently disable cgroups
When running in a container we might not have the necessary privileges to mount cgroups. Don't cause error in this case, just log it. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
1b5b37c06b
commit
74ad34a0c5
1 file changed
+3
-1
+3
-1
@@ -466,8 +466,10 @@ void cgroup_init(uev_ctx_t *ctx)
|
|||||||
if (mount("none", FINIT_CGPATH, "cgroup2", opts, NULL)) {
|
if (mount("none", FINIT_CGPATH, "cgroup2", opts, NULL)) {
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
logit(LOG_NOTICE, "Kernel does not support cgroups v2, disabling.");
|
logit(LOG_NOTICE, "Kernel does not support cgroups v2, disabling.");
|
||||||
|
else if (errno == EPERM) /* Probably inside an unpriviliged container */
|
||||||
|
logit(LOG_NOTICE, "Not allowed to mount cgroups v2, disabling.");
|
||||||
else
|
else
|
||||||
_pe("Failed mounting cgroup v2, disabling.");
|
_pe("Failed mounting cgroup v2");
|
||||||
avail = 0;
|
avail = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user