luci: go.chromium.org/luci/common/system/signals Index | Files

package signals

import "go.chromium.org/luci/common/system/signals"

Package signals makes it easier to catch SIGTERM.

Index

Package Files

interrupt.go signals_unix.go

func HandleInterrupt Uses

func HandleInterrupt(fn func()) (stopper func())

HandleInterrupt calls 'fn' in a separate goroutine on SIGTERM or Ctrl+C.

When SIGTERM or Ctrl+C comes for a second time, logs to stderr and kills the process immediately via os.Exit(1).

Returns a callback that can be used to remove the installed signal handlers.

func Interrupts Uses

func Interrupts() []os.Signal

Interrupts returns signals to interpret as interrupts.

Package signals imports 4 packages (graph) and is imported by 11 packages. Updated 2019-09-23. Refresh now. Tools for package owners.