Documentation
¶
Overview ¶
Package procgroup verifies and terminates process groups using kernel identities.
Index ¶
- func ProcessStart(pid int) (string, error)
- func SameProcess(a, b ProcessIdentity) bool
- func Snapshot(ctx context.Context, identities []ProcessIdentity) (map[int]Entry, error)
- func Stop(ctx context.Context, state Group, persist func([]ProcessIdentity) error) error
- type Entry
- type Group
- type ProcessIdentity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessStart ¶
ProcessStart returns the process birth time scoped to the current kernel boot.
func SameProcess ¶
func SameProcess(a, b ProcessIdentity) bool
SameProcess compares complete process identities, never accepting an empty start.
Types ¶
type Entry ¶
type Entry struct {
ProcessIdentity
Command string
Zombie bool
Exiting bool
}
Entry is one observed process, including status needed to verify group lifetime.
type Group ¶
type Group struct {
Process ProcessIdentity
Members []ProcessIdentity
UID int
Command string
AllowUnlaunched bool
Done bool
}
Group contains only the recorded facts needed to authorize inspection and signaling. Command is the expected leader command substring; callers decide which unlaunched lifecycle states are safe through AllowUnlaunched.
type ProcessIdentity ¶
type ProcessIdentity struct {
PID int `json:"pid"`
PGID int `json:"pgid"`
UID int `json:"uid"`
Started string `json:"started"`
}
ProcessIdentity binds a PID and group to its execution user and kernel birth identity.
func LaunchedIdentity ¶
func LaunchedIdentity(table map[int]Entry, pid, uid int) (ProcessIdentity, error)
LaunchedIdentity verifies a newly launched leader before its execution gate opens.