fix: kill all processes of cgroup before exit
This commit is contained in:
parent
6cc4bd0638
commit
f4c7536a84
1 changed files with 5 additions and 0 deletions
|
@ -66,6 +66,11 @@ void remove_cgroup() {
|
|||
char cwd[PATH_MAX];
|
||||
getcwd(cwd,sizeof(cwd));
|
||||
chdir(cgroups_path);
|
||||
chdir(cgroup_name);
|
||||
write_file("cgroup.kill","1\n");
|
||||
struct timespec tw = {0,5};
|
||||
nanosleep(&tw,NULL);
|
||||
chdir("..");
|
||||
rmdir(cgroup_name);
|
||||
chdir(cwd);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue