Documentation
¶
Index ¶
- func NewLog(path string) *os.File
- func SetSubreaper() error
- func WithArgs(s ...string) func(cfg *Config) error
- func WithGracefulTimeout(d time.Duration) func(cfg *Config) error
- func WithKillProcessGroup(b bool) func(cfg *Config) error
- func WithKillSignal(i int) func(cfg *Config) error
- func WithName(s string) func(cfg *Config) error
- func WithSTDIN(f *os.File) func(cfg *Config) error
- func WithStateDir(s string) func(cfg *Config) error
- func WithTemporaryStateDir() func(cfg *Config) error
- func WithWorkDir(s string) func(cfg *Config) error
- type Config
- type Option
- type Process
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetSubreaper ¶
func SetSubreaper() error
SetSubreaper configures the calling process to be a subreaper. A subreaper fulfills the role of init(1) for its descendant processes. When a process becomes orphaned (its immediate parent terminates), it will be reparented to the nearest still living ancestor subreaper. This is useful in containerized environments to ensure proper cleanup of orphaned child processes.
func WithGracefulTimeout ¶
WithGracefulTimeout sets the duration to wait after SIGTERM before SIGKILL
func WithKillProcessGroup ¶
WithKillProcessGroup enables or disables killing the entire process group
func WithKillSignal ¶
WithKillSignal sets the given signal while attemping to stop. Defaults to 9
func WithStateDir ¶
func WithTemporaryStateDir ¶
func WithWorkDir ¶
Types ¶
type Config ¶
type Config struct {
Name string
Args []string
Combined bool
StateDir string
KillSignal *int
Environment []string
Stdin *os.File
WorkDir string
GracefulTimeout time.Duration // Time to wait after SIGTERM before SIGKILL
KillProcessGroup bool // Whether to kill entire process group (default true)
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Option ¶
func WithEnvironment ¶
type Process ¶
type Process struct {
PID string
// contains filtered or unexported fields
}
func (*Process) StderrPath ¶
StderrPath returns the file where the stderr of the process is appended to
func (*Process) StdoutPath ¶
StdoutPath returns the file where the stdout is appended to