Skip to content

Commit

Permalink
Only log signal forwarding if there are services.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuxdude committed Feb 17, 2022
1 parent e172a09 commit 6af6eb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions service_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,14 @@ func (s *serviceManagerImpl) handleServiceTermination(serv *launchedServiceInfo,
}

func (s *serviceManagerImpl) multicastSig(sig os.Signal) int {
s.log.Infof("Signal Forwader - Chaining signal: %q to all services", sig)

s.servicesMu.Lock()
defer s.servicesMu.Unlock()

count := len(s.services)
if count > 0 {
s.log.Infof("Signal Forwader - Chaining signal: %q to %d services", sig, count)
}

for pid := range s.services {
err := unix.Kill(pid, sig.(unix.Signal))
if err != nil {
Expand Down

0 comments on commit 6af6eb3

Please sign in to comment.