You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, runc checks the existence of init process inside a container to figure out whether the container is running or not. This is a correct thing to do for a container having its own PID namespace.
Yet, for the container which does not have its own pid namespace (i.e. it shares pidns with the host or possibly another container), merely checking that init is there is not a good way to say whether the container is running or not. In fact, init might be already killed or exited, and other container processes remain.
Since #3132 is fixed, for a no-pidns container we can instead say that the container is running if its cgroup has some processes running. While at it, it might make sense to disallow creating containers with shared or no cgroup and no pidns.
for a no-pidns container we can instead say that the container is running if its cgroup has some processes running.
I think we can still consider the container as stopped. But the runc kill should always send the signal to all the processes in the cgroup if the cgroup is still here. Otherwise, the runc delete will fail.
This is a very rare corner case, so yes, let's assume the container as stopped if it has no initial process running. Things were working this way and there's no need to change it.
Description
Currently, runc checks the existence of init process inside a container to figure out whether the container is running or not. This is a correct thing to do for a container having its own PID namespace.
Yet, for the container which does not have its own pid namespace (i.e. it shares pidns with the host or possibly another container), merely checking that init is there is not a good way to say whether the container is running or not. In fact, init might be already killed or exited, and other container processes remain.
Since #3132 is fixed, for a no-pidns container we can instead say that the container is running if its cgroup has some processes running. While at it, it might make sense to disallow creating containers with shared or no cgroup and no pidns.
References:
The text was updated successfully, but these errors were encountered: