We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71d2346 commit f073a42Copy full SHA for f073a42
os/kill.go
@@ -62,7 +62,11 @@ func getAllChildren(proc *process.Process) []*process.Process {
62
// SIGCONT to prevent processes from forking during termination, so we will not
63
// have orphaned processes after.
64
func wrapWithStopAndCont(signal syscall.Signal, pgids []int) error {
65
- signals := []syscall.Signal{syscall.SIGSTOP, signal, syscall.SIGCONT}
+ signals := []syscall.Signal{syscall.SIGSTOP, signal}
66
+ if signal != syscall.SIGKILL { // no point in sending any signal after SIGKILL
67
+ signals = append(signals, syscall.SIGCONT)
68
+ }
69
+
70
for _, currentSignal := range signals {
71
if err := sendSignalToProcessGroups(currentSignal, pgids); err != nil {
72
return err
0 commit comments