Now specify HandleSignal as an option to toggle signal handling. (#948)

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
This commit is contained in:
Erik Hollensbe
2019-11-16 03:13:34 -08:00
committed by Asim Aslam
parent bec13a45cd
commit a1c6cdf193
2 changed files with 15 additions and 1 deletions

View File

@@ -169,7 +169,9 @@ func (s *service) Run() error {
}
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
if s.opts.Signal {
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
}
select {
// wait on kill signal