assert(controller);
/* This safely kills all processes; first it sends a SIGTERM,
- * then checks 8 times after 50ms whether the group is
- * now empty, and finally kills everything that is left with
- * SIGKILL */
+ * then checks 8 times after 200ms whether the group is now
+ * empty, then kills everything that is left with SIGKILL and
+ * finally checks 5 times after 200ms each whether the group
+ * is finally empty. */
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < 15; i++) {
int sig, r;
if (i <= 0)
sig = SIGTERM;
- else if (i >= 9)
+ else if (i == 9)
sig = SIGKILL;
else
sig = 0;
if ((r = cg_kill_recursive(controller, path, sig, true, rem, NULL)) <= 0)
return r;
- usleep(50 * USEC_PER_MSEC);
+ usleep(200 * USEC_PER_MSEC);
}
return 0;