nspawn: create /sys/fs/cgroup for unified hierarchy as well
This commit is contained in:
parent
3a3f71e5f0
commit
88e1057286
|
@ -710,13 +710,15 @@ static int mount_unified_cgroups(const char *dest) {
|
||||||
|
|
||||||
assert(dest);
|
assert(dest);
|
||||||
|
|
||||||
p = strjoina(dest, "/sys/fs/cgroup");
|
p = prefix_roota(dest, "/sys/fs/cgroup");
|
||||||
|
|
||||||
|
(void) mkdir_p(p, 0755);
|
||||||
|
|
||||||
r = path_is_mount_point(p, AT_SYMLINK_FOLLOW);
|
r = path_is_mount_point(p, AT_SYMLINK_FOLLOW);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to determine if %s is mounted already: %m", p);
|
return log_error_errno(r, "Failed to determine if %s is mounted already: %m", p);
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
p = strjoina(dest, "/sys/fs/cgroup/cgroup.procs");
|
p = prefix_roota(dest, "/sys/fs/cgroup/cgroup.procs");
|
||||||
if (access(p, F_OK) >= 0)
|
if (access(p, F_OK) >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
|
|
Loading…
Reference in a new issue