reaper

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package reaper implements zombie process reaper with notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Notify

func Notify(ch chan<- ProcessInfo) bool

Notify causes reaper to deliver notifications about reaped zombies.

If Notify returns false, reaper is not running, and Notify does nothing.

func ProcessWaitWrapper added in v0.1.2

func ProcessWaitWrapper(usingReaper bool, notifyCh <-chan ProcessInfo, proc *os.Process) error

ProcessWaitWrapper emulates os/exec.Process.Wait() when reaper is running. It is equivalent to WaitWrapper

ProcessWaitWrapper(true, proc) should be equivalent to proc.Wait().

func Run

func Run()

Run launches loop for the zombie process reaper.

func Shutdown

func Shutdown()

Shutdown stops the process reaper.

func Stop

func Stop(ch chan<- ProcessInfo)

Stop sending notifications to the channel.

func WaitWrapper

func WaitWrapper(usingReaper bool, notifyCh <-chan ProcessInfo, cmd *exec.Cmd) error

WaitWrapper emulates os/exec.Command.Wait() when reaper is running.

WaitWrapper(true, cmd) should be equivalent to cmd.Wait().

Types

type ExitError

type ExitError struct {
	ExitCode int
}

ExitError is raised when exit status is not equal to 0.

func (*ExitError) Error

func (exitError *ExitError) Error() string

Error implements error interface.

type ProcessInfo

type ProcessInfo struct {
	Pid    int
	Status syscall.WaitStatus
}

ProcessInfo describes reaped zombie process.

Jump to

Keyboard shortcuts

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