kill

package module
v0.0.0-...-618d1a5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 2 Imported by: 5

README

Kill

Go package for killing processes across different platforms. Handles killing children of processes as well as the process itself.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kill

func Kill(cmd *exec.Cmd) error

Kill kills a process. If the process has Setpgid == true, then we have anticipated that it might spawn its own child processes, so we've given it a process group ID (PGID) equal to its process id (PID) and given its child processes will inherit the PGID, we can kill that group, rather than killing the process itself.

func PrepareForChildren

func PrepareForChildren(cmd *exec.Cmd)

PrepareForChildren ensures that child processes of this parent process will share the same group id as the parent, meaning when the call Kill on the parent process, we'll kill the whole group, parent and children both. Gruesome when you think about it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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