fix: kill all processes of cgroup before exit

This commit is contained in:
dragonmuffin 2024-09-23 20:40:55 +05:00
parent 6cc4bd0638
commit f4c7536a84

View file

@ -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);
}