preflight

package
v0.12.49 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitPortFree

func WaitPortFree(port int, timeout time.Duration) bool

WaitPortFree polls until port is free or timeout expires.

Types

type KillResult

type KillResult struct {
	PortConflict
	Killed bool   `json:"killed"`
	Error  string `json:"error,omitempty"`
}

KillResult reports what happened for each conflict.

func KillPortBlockers

func KillPortBlockers(ctx context.Context, pm *goprocess.ProcessManager, conflicts []PortConflict) []KillResult

KillPortBlockers kills processes blocking declared ports using the ProcessManager's full escalation path (process groups + descendants). Verifies each port is free after kill.

type PortConflict

type PortConflict struct {
	ScriptName  string `json:"script_name"`
	Port        int    `json:"port"`
	PIDs        []int  `json:"pids"`
	ProcessName string `json:"process_name,omitempty"`
}

PortConflict describes an unmanaged process blocking a declared port.

func DetectPortConflicts

func DetectPortConflicts(ctx context.Context, scripts map[string]*config.ScriptConfig, managedPIDs map[int]bool) []PortConflict

DetectPortConflicts scans all declared ports from autostart scripts and returns conflicts where unmanaged processes hold those ports.

Jump to

Keyboard shortcuts

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