make container_is_running more robust
The current logic we use to test if the container is running is
to check if the container exist in the cgroup filesystem. If it does,
we check if there are tasks left in any of those controllers.
If works well, assuming we are in control all the time.
Kir demonstrated that this fails if someone removes one of the
controllers from the hierarchy. In that case we'll fail because the
controller doesn't exist.
This patch makes the code more robust, and vzctl will properly report
container down in that situation.
Signed-off-by: Glauber Costa <glommer@parallels.com>
1 file changed