killdren

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 2 Imported by: 4

README

killdren

Do best to kill your children.

Go Reference Go Report Card

This package tries to kill child process and "grandchild process" when main process shutdown or panic.

Install

go get gopkg.ilharper.com/x/killdren

Usage

// Starting
cmd := &exec.Cmd{
	// ...
}
killdren.Set(cmd)
err := cmd.Run()

// Stopping
err := killdren.Stop(cmd)

Go Reference

LICENSE

MIT

Documentation

Overview

Package killdren do these two things:

  • Do best to ensure children get killed when panic
  • Stop/kill all "grandchild process" when stop/kill child process

"grandchild process": "child process" started by child process started in go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kill

func Kill(cmd *exec.Cmd) error

func Set

func Set(cmd *exec.Cmd)

func Signal

func Signal(cmd *exec.Cmd, sig syscall.Signal) error

func Stop

func Stop(cmd *exec.Cmd) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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