Skip to content

Add runsc kill --pgid#12908

Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
test/cl897368159
Open

Add runsc kill --pgid#12908
copybara-service[bot] wants to merge 1 commit intomasterfrom
test/cl897368159

Conversation

@copybara-service
Copy link
Copy Markdown

Add runsc kill --pgid

Follow up PR of #12739 for adding runsc kill --pgid xxx support.

Changes

Adds a --pgid flag to runsc kill that sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing --pid and --all flags.

The signal is delivered through the existing ContMgrSignal RPC via a new DeliverToProcessGroup delivery mode, following the same container -> sandbox -> loader chain as the other signal modes.

Testing

TestSignalProcessGroup creates a 3-process container (init -> child -> grandchild) where the child calls setpgid to form a new process group shared with the grandchild. The test sends SIGKILL to that PGID and verifies:

  • Both child and grandchild are killed
  • Init (PGID 1) survives

A new task-tree-pgid test app subcommand supports this by spawning a deterministic process tree with a distinct process group.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12905 from danielpfeifer02:dpfeifer/runsc-kill-pgid 7afe641

Follow up PR of #12739 for adding `runsc kill --pgid xxx` support.

## Changes ##
Adds a `--pgid` flag to `runsc kill` that sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing `--pid` and `--all` flags.

The signal is delivered through the existing `ContMgrSignal` `RPC` via a new `DeliverToProcessGroup` delivery mode, following the same `container -> sandbox -> loader` chain as the other signal modes.

## Testing ##
`TestSignalProcessGroup` creates a 3-process container (`init -> child -> grandchild`) where the child calls `setpgid` to form a new process group shared with the grandchild. The test sends `SIGKILL` to that PGID and verifies:

- Both child and grandchild are killed
- Init (PGID 1) survives

A new `task-tree-pgid` test app subcommand supports this by spawning a deterministic process tree with a distinct process group.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12905 from danielpfeifer02:dpfeifer/runsc-kill-pgid 7afe641
PiperOrigin-RevId: 897368159
@copybara-service copybara-service bot added the exported Issue was exported automatically label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant