Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: just signal all processes inside the container #2037

Closed
wants to merge 2 commits into from

Conversation

lifubang
Copy link
Member

@lifubang lifubang commented Apr 9, 2019

runc kill --help says:
--all, -a send the specified signal to all processes inside the container

But if we use shared cgroup path to create 2 containers a & b.
When we send signal KILL to container a by runc kill -a a 9,
it will also kill container b's processes, not just only processes inside container a.

I think we should have a way to send a signal to just only all processes inside one container, not all processes in shared cgroup path.

This PR provides a way to implement this operation.
The method is to use sub cgroup path in freezer cgroup subsystem.

I think there are some discussion in:
containerd/containerd#2558
containerd/containerd#3149
We don't know when to use runc kill -a cid in Shared cgroup path and Shared pid namespace.
https://github.com/lifubang/runc/blob/dd2d6faab8ca804c7ab320003d69306917812c07/libcontainer/state_linux.go#L40-L46

And there is another effect:
If we use host pid namespace, we must use signalAllProcess to kill all processes inside the container when destroy the container, but if we have used shared cgroup path, other container's processes will be killed at that time.

Signed-off-by: Lifubang [email protected]

@kolyshkin
Copy link
Contributor

Since v1.1.0, we no longer allow shared cgroups (see #3132, #3223), thus closing.

@kolyshkin kolyshkin closed this Nov 28, 2023
@kolyshkin
Copy link
Contributor

(and the latest shared pidns discussion happened in #4102)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants