@@ -610,7 +610,7 @@ void cgroup_kill()
610
610
int size;
611
611
do {
612
612
pid_t * pids;
613
- int ret = cgroup_get_procs (cgroupname, NULL , &pids, &size);
613
+ int ret = cgroup_get_procs (cgroupname, " memory " , &pids, &size);
614
614
if (ret != 0 ) error (ret, " cgroup_get_procs" );
615
615
for (int i = 0 ; i < size; i++) {
616
616
kill (pids[i], SIGKILL);
@@ -646,8 +646,9 @@ void cgroup_delete()
646
646
}
647
647
/* Clean up our cgroup */
648
648
nanosleep (&cg_delete_delay,nullptr );
649
- int ret = cgroup_delete_cgroup_ext (cg, CGFLAG_DELETE_IGNORE_MIGRATION | CGFLAG_DELETE_RECURSIVE);
650
- if ( ret!=0 ) error (ret," deleting cgroup" );
649
+ int ret = cgroup_delete_cgroup_ext (cg, CGFLAG_DELETE_IGNORE_MIGRATION | CGFLAG_DELETE_RECURSIVE);
650
+ // TODO: is this actually benign?
651
+ if ( ret!=0 && ret!=ECGOTHER ) error (ret," deleting cgroup" );
651
652
652
653
cgroup_free (&cg);
653
654
@@ -862,7 +863,8 @@ void setrestrictions()
862
863
863
864
/* Put the child process in the cgroup */
864
865
if (is_cgroup_v2) {
865
- if (cgroup_change_cgroup_path (cgroupname, getpid (), NULL ) != 0 ) {
866
+ const char *controllers[] = { " cpu" , " memory" , " cpuset" , NULL };
867
+ if (cgroup_change_cgroup_path (cgroupname, getpid (), controllers) != 0 ) {
866
868
error (0 , " Failed to move the process to the cgroup" );
867
869
}
868
870
} else {
@@ -1351,6 +1353,7 @@ int main(int argc, char **argv)
1351
1353
error (errno," cannot start `%s'" ,cmdname);
1352
1354
1353
1355
default : /* become watchdog */
1356
+ verbose (" child pid = %d" , child_pid);
1354
1357
/* Shed privileges, only if not using a separate child uid,
1355
1358
because in that case we may need root privileges to kill
1356
1359
the child process. Do not use Linux specific setresuid()
0 commit comments