https://github.com/gwuah/go-process-killer
a program that hunts for all go processes and kills them
https://github.com/gwuah/go-process-killer
Last synced: 2 months ago
JSON representation
a program that hunts for all go processes and kills them
- Host: GitHub
- URL: https://github.com/gwuah/go-process-killer
- Owner: gwuah
- Created: 2021-03-15T21:26:34.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T22:56:33.000Z (about 4 years ago)
- Last Synced: 2023-08-01T07:13:23.729Z (over 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-process-killer
a program that hunts for all go processes and kills them.# How To Run
- Clone repository
- Build `go run main.go` and run `./main`
- Or you can just run it directly using `go run main.go`# Note
This program will actually terminate all processes the kernel creates for golang binaries. so things like your go programming language server and what not will stop functioning.
So unless you want to code without intelisense, then by all means, be my guest.# Proof
So to validate my program, I created a tiny go program that prints the value returned from a ticker every second.
Once it starts running, I run the process killer and you notice that it shuts down with a code of 9.
See image below.# Notes
- Ideally, you should always use SIGTERM, instead of SIGKILL, as the former allows the process to cleanup.
- You want to make sure you're not killing yourself in the process (no pun intended)
- I took the code for checking if a process was created by a go binary from here -> https://github.com/google/gops/blob/55729d43c2835298a7e05e576a77da2989ff5b7b/goprocess/gp.go#L113