aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-03-16 19:59:06 +0000
committerGravatar Joe Banks <[email protected]>2021-03-16 19:59:06 +0000
commit75b806ffd2714e4e623973a2fe0345293dd3512c (patch)
treea5bf2ea6c1353f2425f339bb4f893df0e620d319
parentChange SIGKILL to SIGTERM (diff)
Remove logic for removing remnant cgroups
This should be addressed by sending SIGTERM to nsjail instead of SIGKILL, since nsjail then gets an opportunity to run clean-up logic which includes removing cgroups.
-rw-r--r--snekbox/nsjail.py12
1 files changed, 0 insertions, 12 deletions
diff --git a/snekbox/nsjail.py b/snekbox/nsjail.py
index 4a13adb..814b46c 100644
--- a/snekbox/nsjail.py
+++ b/snekbox/nsjail.py
@@ -224,18 +224,6 @@ class NsJail:
log.info(f"nsjail return code: {returncode}")
- # If we hit a cgroup limit then there is a chance the nsjail cgroups did not
- # get removed. If we don't remove them then when we try remove the parents
- # we will get a "Device or resource busy" error.
-
- children = []
-
- children.extend(Path(self.config.cgroup_mem_mount, cgroup).glob("NSJAIL.*"))
- children.extend(Path(self.config.cgroup_pids_mount, cgroup).glob("NSJAIL.*"))
-
- for child in children:
- child.rmdir()
-
# Remove the dynamically created cgroups once we're done
Path(self.config.cgroup_mem_mount, cgroup).rmdir()
Path(self.config.cgroup_pids_mount, cgroup).rmdir()