def _kill_crgoup_tasks(self, controller):
    'Simulate wait on pid.\n\n        Read the tasks file and stay there until /proc/{pid}\n        disappears. The retry function that calls this code makes\n        sure we do not timeout.\n        '
    tasks_file = '/sys/fs/cgroup/{}/{}/{}/tasks'.format(controller, FC_BINARY_NAME, self.jailer_id)
    if (not os.path.exists(tasks_file)):
        return True
    cmd = 'cat {}'.format(tasks_file)
    tasks = run(cmd, shell=True, stdout=PIPE).stdout.decode('utf-8')
    tasks_split = tasks.splitlines()
    for task in tasks_split:
        if os.path.exists('/proc/{}'.format(task)):
            raise TimeoutError
    return True
Simulate wait on pid.

Read the tasks file and stay there until /proc/{pid}
disappears. The retry function that calls this code makes
sure we do not timeout.
def _kill_crgoup_tasks(self, controller):
    'Simulate wait on pid.\n\n        Read the tasks file and stay there until /proc/{pid}\n        disappears. The retry function that calls this code makes\n        sure we do not timeout.\n        '
    tasks_file = '/sys/fs/cgroup/{}/{}/{}/tasks'.format(controller, FC_BINARY_NAME, self.jailer_id)
    if (not os.path.exists(tasks_file)):
        return True
    cmd = 'cat {}'.format(tasks_file)
    tasks = run(cmd, shell=True, stdout=PIPE).stdout.decode('utf-8')
    tasks_split = tasks.splitlines()
    for task in tasks_split:
        if os.path.exists('/proc/{}'.format(task)):
            raise TimeoutError
    return True