nspawn: create /sys/fs/cgroup for unified hierarchy as well

This commit is contained in:
Mirco Tischler 2015-10-09 13:12:08 +02:00
parent 3a3f71e5f0
commit 88e1057286
1 changed files with 4 additions and 2 deletions

View File

@ -710,13 +710,15 @@ static int mount_unified_cgroups(const char *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);
if (r < 0)
return log_error_errno(r, "Failed to determine if %s is mounted already: %m", p);
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)
return 0;
if (errno != ENOENT)