Skip to content

Commit

Permalink
Change KillTree to no longer send SIGCONT after SIGKILL (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbetkier authored and Oskar Jagodziński committed Nov 26, 2019
1 parent 71d2346 commit f073a42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion os/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ func getAllChildren(proc *process.Process) []*process.Process {
// SIGCONT to prevent processes from forking during termination, so we will not
// have orphaned processes after.
func wrapWithStopAndCont(signal syscall.Signal, pgids []int) error {
signals := []syscall.Signal{syscall.SIGSTOP, signal, syscall.SIGCONT}
signals := []syscall.Signal{syscall.SIGSTOP, signal}
if signal != syscall.SIGKILL { // no point in sending any signal after SIGKILL
signals = append(signals, syscall.SIGCONT)
}

for _, currentSignal := range signals {
if err := sendSignalToProcessGroups(currentSignal, pgids); err != nil {
return err
Expand Down

0 comments on commit f073a42

Please sign in to comment.