diff options
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c index 5c95b7c..6bf281f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -339,8 +339,7 @@ void chk_chroot(void) return; } - E("%s", "Can not mount filesystem as slave"); - exit(EXIT_FAILURE); + W2("%s", "Can not mount filesystem as slave/private"); } void mount_root(void) @@ -348,6 +347,8 @@ void mount_root(void) int s; s = mount("none", "/", "", MS_SLAVE|MS_REC, NULL); if (s) + s = mount("none", "/", "", MS_PRIVATE|MS_REC, NULL); + if (s) chk_chroot(); } @@ -488,6 +489,8 @@ int cgroups_set(void) const char *rt_period_limit = cfs_period_limit; const char rt_runtime[] = "cpu.rt_runtime_us"; const char *rt_runtime_limit = cfs_quota_limit; + const char ccpus[] = "cpuset.cpus"; + const char cmems[] = "cpuset.mems"; if (remove(cgmem) && errno != ENOENT) return 1; @@ -521,6 +524,9 @@ int cgroups_set(void) if (s) return 1; + s |= cgroups_write_file(cgdef, ccpus, "0", 1); + s |= cgroups_write_file(cgdef, cmems, "0", 1); + _cgmem = cgdef; _cgcpu = cgdef; _cgpid = cgdef; |