sysproc

package
v0.22.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sysproc — process-group reaping helpers shared across clawtool callsites (Bash tool, Verify tool, hooks subsystem). The pattern mirrors internal/tools/core/exec_unix.go but lives in its own package so non-tool callers (hooks, future plan runner) can reuse it without an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyGroup

func ApplyGroup(cmd *exec.Cmd)

ApplyGroup makes cmd run in its own process group so KillGroup can SIGKILL the whole tree (including shell children like `sleep` that would otherwise hold stdio pipes open and stall Wait).

Callers that use exec.CommandContext can additionally set cmd.Cancel themselves to wire context cancellation to the group kill — we deliberately don't touch cmd.Cancel here because plain exec.Command() rejects a non-nil Cancel at Start time.

func ApplyGroupWithCtxCancel

func ApplyGroupWithCtxCancel(cmd *exec.Cmd)

ApplyGroupWithCtxCancel is the CommandContext-friendly variant: it sets Setpgid AND wires cmd.Cancel to the group SIGKILL. Use this when you've created the command via exec.CommandContext and want ctx-cancellation to reap the whole tree.

func KillGroup

func KillGroup(cmd *exec.Cmd)

KillGroup sends SIGKILL to the whole process group cmd.Process leads. Safe to call after Start; no-op when Process is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL