Minor cgroup documentation fixes.
authorDan Sanders <sandersd@google.com>
Mon, 20 Jun 2016 19:54:05 +0000 (12:54 -0700)
committerDan Sanders <sandersd@google.com>
Mon, 20 Jun 2016 20:37:34 +0000 (13:37 -0700)
README.md
cgroup.c

index 6e2b01f27e26bd1f1dd21f137e3aa41c95153187..3059678071220c0f7eb8839a600394e4720dea05 100644 (file)
--- a/README.md
+++ b/README.md
@@ -243,12 +243,12 @@ Options:
        Number of bytes to allocate for tmpfsmounts (default: 4194304)
  --disable_proc 
        Disable mounting /proc in the jail
+ --cgroup_mem_max VALUE
+       Maximum number of bytes to use in the group (default: '0' - disabled)
  --cgroup_mem_mount VALUE
-       Where to mount memory cgroup FS (default: '/cgroup_memory'
+       Location of memory cgroup FS (default: '/sys/fs/cgroup/memory')
  --cgroup_mem_parent VALUE
-       Which memory cgroup to use (default: 'NSJAIL')
- --cgroup_mem_max VALUE
-       Maximum number of bytes to use in the group
+       Which pre-existing memory cgroup to use as a parent (default: 'NSJAIL')
  --iface_no_lo 
        Don't bring up the 'lo' interface
  --iface|-I VALUE
@@ -267,5 +267,6 @@ Options:
   nsjail -Mr --chroot / -- /bin/echo "ABC"
  Run echo command once only, as a sub-process
   nsjail -Mo --chroot / -- /bin/echo "ABC"
- Execute echo command directly, without a supervising proces
+ Execute echo command directly, without a supervising process
+  nsjail -Me --chroot / --disable_proc -- /bin/echo "ABC"
 ```
index 6079675cf24dc7cc9aa2b3ee6ed3dcde32c7c230..405c327ef08b9efe4ed235daa4a23accf5ffcff6 100644 (file)
--- a/cgroup.c
+++ b/cgroup.c
@@ -67,7 +67,7 @@ bool cgroupInitNsFromParent(struct nsjconf_t *nsjconf, pid_t pid)
         * Use OOM-killer instead of making processes hang/sleep
         */
        snprintf(fname, sizeof(fname), "%s/memory.oom_control", mem_cgroup_path);
-       LOG_D("Writting '1' '%s'", fname);
+       LOG_D("Writting '0' '%s'", fname);
        if (utilWriteBufToFile(fname, "0", strlen("0"), O_WRONLY) == false) {
                LOG_E("Could not update memory cgroup oom control");
                return false;