mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-03 16:21:14 +01:00
17 lines
276 B
Go
17 lines
276 B
Go
|
package procutil
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"os/signal"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
// WaitForSigterm waits fro either SIGTERM or SIGINT
|
||
|
//
|
||
|
// Returns the caught signal.
|
||
|
func WaitForSigterm() os.Signal {
|
||
|
ch := make(chan os.Signal, 1)
|
||
|
signal.Notify(ch, os.Interrupt, syscall.SIGTERM)
|
||
|
return <-ch
|
||
|
}
|