reaper

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2016 License: MIT, MIT Imports: 4 Imported by: 0

README

go-reaper

Process (grim) reaper library for golang - this is useful for cleaning up zombie processes inside docker containers (which do not have an init process running as pid 1).

tl;dr

   import reaper "github.com/ramr/go-reaper"

   func main() {
	//  Start background reaping of orphaned child processes.
	go reaper.Reap()

	//  Rest of your code ...
   }

How and Why

If you run a container without an init process (pid 1) which would normally reap zombie processes, you could well end up with a lot of zombie processes and eventually exhaust the max process limit on your system.

If you have a golang program that runs as pid 1, then this library allows the golang program to setup a background signal handling mechanism to handle the death of those orphaned children and not create a load of zombies inside the pid namespace your container runs in.

Usage:

See the tl;dr section above.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reap

func Reap()

Entry point for the reaper code. Start reaping children in the background inside a goroutine.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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