Skip to content

Commit ff751cd

Browse files
committed
fix: cross-platform process signal for Windows goreleaser build
1 parent 3985f25 commit ff751cd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/oktsec/commands/run.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,11 @@ func killExistingInstance() {
461461
}
462462
var other int
463463
if _, err := fmt.Sscanf(line, "%d", &other); err == nil && other != pid {
464-
_ = syscall.Kill(other, syscall.SIGTERM)
465-
// Brief wait for graceful shutdown.
466-
time.Sleep(200 * time.Millisecond)
464+
if p, err := os.FindProcess(other); err == nil {
465+
_ = p.Signal(os.Interrupt)
466+
// Brief wait for graceful shutdown.
467+
time.Sleep(200 * time.Millisecond)
468+
}
467469
}
468470
}
469471
}

0 commit comments

Comments
 (0)