Skip to content

Commit

Permalink
clarify kill and delete operation
Browse files Browse the repository at this point in the history
Signed-off-by: lifubang <[email protected]>
  • Loading branch information
lifubang committed Oct 6, 2023
1 parent 6331715 commit 126ee4a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

### <a name="runtimeKill" />Kill
`kill <container-id> <signal>`
`kill <container-id> [-a,--all] <signal>`

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).

### <a name="runtimeDelete" />Delete
`delete <container-id>`
`delete [-f,--force] <container-id>`

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.

Expand Down

0 comments on commit 126ee4a

Please sign in to comment.