@@ -84,22 +84,6 @@ func (s *Supervisor) Wait() error {
8484 return s .cmd .Wait ()
8585}
8686
87- func (s * Supervisor ) Signal (sig os.Signal ) error {
88- s .startStopLock .Lock ()
89- defer s .startStopLock .Unlock ()
90-
91- // Process set by Start
92- if s .cmd .Process == nil {
93- return errors .New ("cannot signal unstarted child process" )
94- }
95-
96- err := s .cmd .Process .Signal (sig )
97- if err != nil {
98- return fmt .Errorf ("failed to signal child process: %v" , err )
99- }
100- return nil
101- }
102-
10387func (s * Supervisor ) ShutdownNow () error {
10488 s .startStopLock .Lock ()
10589 defer s .startStopLock .Unlock ()
@@ -112,7 +96,7 @@ func (s *Supervisor) ShutdownNow() error {
11296 log .Println ("Killing child process..." )
11397 // TODO: Use Process.Kill() instead?
11498 // Sending Interrupt on Windows is not implemented.
115- err := s .Signal (syscall .SIGKILL )
99+ err := s .cmd . Process . Signal (syscall .SIGKILL )
116100 if err != nil {
117101 return fmt .Errorf ("failed to kill child process: %v" , err )
118102 }
@@ -133,7 +117,7 @@ func (s *Supervisor) ShutdownWithTimeout(timeout time.Duration) error {
133117 }
134118
135119 log .Println ("Terminating child process..." )
136- err := s .Signal (syscall .SIGTERM )
120+ err := s .cmd . Process . Signal (syscall .SIGTERM )
137121 if err != nil {
138122 return fmt .Errorf ("failed to terminate child process: %v" , err )
139123 }
0 commit comments