reaper

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reaper contains logic for reaping subprocesses. It is specifically used in the agent to avoid the accumulation of zombie processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForkReap

func ForkReap(pids reap.PidCh) error

ForkReap spawns a goroutine that reaps children. In order to avoid complications with spawning `exec.Commands` in the same process that is reaping, we forkexec a child process. This prevents a race between the reaper and an exec.Command waiting for its process to complete. The provided 'pids' channel may be nil if the caller does not care about the reaped children PIDs.

func IsChild

func IsChild() bool

IsChild returns true if we're the forked process.

func IsInitProcess

func IsInitProcess() bool

IsInitProcess returns true if the current process's PID is 1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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