braintree / manners

A polite Go HTTP server that shuts down gracefully.
MIT License
997 stars 103 forks source link

Signal example should use syscall.SIGTERM instead of os.Kill #45

Open nathany opened 7 years ago

nathany commented 7 years ago

Regarding the documented signals example, os.Kill can't be caught, it's just there for killing other processes.

os.Kill is like kill -9 which kills a process immediately

syscall.SIGTERM is equivalent to kill which allows the process time to cleanup

signal.Notify(sigchan, os.Interrupt, syscall.SIGTERM)

ref: #9