From 126ee4a0be26ace48f3e8118f03355786029c1dd Mon Sep 17 00:00:00 2001 From: lifubang Date: Fri, 6 Oct 2023 09:25:12 +0800 Subject: [PATCH] clarify kill and delete operation Signed-off-by: lifubang --- runtime.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/runtime.md b/runtime.md index d3aaa9b14..71eb07fc6 100644 --- a/runtime.md +++ b/runtime.md @@ -129,18 +129,19 @@ This operation MUST run the user-specified program as specified by [`process`](c This operation MUST generate an error if `process` was not set. ### Kill -`kill ` +`kill [-a,--all] ` This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -This operation MUST send the specified signal to the container process. +This operation MUST send the specified signal to the container process(without `-a`) or to all processes in the container(with `-a`). +Without `-a`, attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors). ### Delete -`delete ` +`delete [-f,--force] ` This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -Deleting a container MUST delete the resources that were created during the `create` step. +Without `-f`, attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +With `-f`, runtime should try its best to delete the container no matter what the state is. +Deleting a container MUST delete the resources that were created during the `create` step, specially, if the container uses `shared pid namespace`, all processes inside the container's cgroup should also be killed first. Note that resources associated with the container, but not created by this container, MUST NOT be deleted. Once a container is deleted its ID MAY be used by a subsequent container.