We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1a0145 commit bdcfba4Copy full SHA for bdcfba4
2 files changed
backend/worker_linux.go
@@ -0,0 +1,21 @@
1
+//go:build linux
2
+// +build linux
3
+
4
+package main
5
6
+import (
7
+ "os/exec"
8
9
+ "golang.org/x/sys/unix"
10
+)
11
12
+func SetSysProcAttr(cmd *exec.Cmd) {
13
+ cmd.SysProcAttr = &unix.SysProcAttr{
14
+ Setpgid: true,
15
+ Pdeathsig: unix.SIGKILL,
16
+ }
17
+}
18
19
+func KillCommand(cmd *exec.Cmd) error {
20
+ return unix.Kill(-cmd.Process.Pid, unix.SIGKILL)
21
backend/worker_unix.go
@@ -1,5 +1,5 @@
-//go:build !windows
-// +build !windows
+//go:build !windows && !linux
+// +build !windows,!linux
package main
@@ -11,8 +11,7 @@ import (
func SetSysProcAttr(cmd *exec.Cmd) {
cmd.SysProcAttr = &unix.SysProcAttr{
- Setpgid: true,
- Pdeathsig: unix.SIGKILL,
}
0 commit comments