so that container root can create sub-cgroups
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
uid_t origuid; // target uid in parent namespace
};
+/*
+ * chgrp the container cgroups to container group. We leave
+ * the container owner as cgroup owner. So we must make the
+ * directories 775 so that the container can create sub-cgroups.
+ */
static int chown_cgroup_wrapper(void *data)
{
struct chown_data *arg = data;
free(fullpath);
return -1;
}
- // TODO - do we need to chown tasks and cgroup.procs too?
+
+ if (chmod(fullpath, 0775) < 0) {
+ SYSERROR("Error chmoding %s\n", fullpath);
+ free(fullpath);
+ return -1;
+ }
free(fullpath);
}