Skip to content

Commit

Permalink
Treat sigterm as a clean shutdown signal (#4277)
Browse files Browse the repository at this point in the history
(cherry picked from commit 40fac0a)
  • Loading branch information
danielnelson committed Jun 12, 2018
1 parent 8cdf39c commit 46fa0d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/telegraf/telegraf.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ func reloadLoop(

shutdown := make(chan struct{})
signals := make(chan os.Signal)
signal.Notify(signals, os.Interrupt, syscall.SIGHUP)
signal.Notify(signals, os.Interrupt, syscall.SIGHUP, syscall.SIGTERM)
go func() {
select {
case sig := <-signals:
if sig == os.Interrupt {
if sig == os.Interrupt || sig == syscall.SIGTERM {
close(shutdown)
}
if sig == syscall.SIGHUP {
Expand Down

0 comments on commit 46fa0d7

Please sign in to comment.