summaryrefslogtreecommitdiff
path: root/osutil/isolate.go
diff options
context:
space:
mode:
Diffstat (limited to 'osutil/isolate.go')
-rw-r--r--osutil/isolate.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/osutil/isolate.go b/osutil/isolate.go
new file mode 100644
index 00000000..d4b64fb6
--- /dev/null
+++ b/osutil/isolate.go
@@ -0,0 +1,13 @@
+// +build !windows
+
+package osutil
+
+import (
+ "os/exec"
+ "syscall"
+)
+
+// IsolateProcess change gpid for the process to avoid bypassing signals to php processes.
+func IsolateProcess(cmd *exec.Cmd) {
+ cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true, Pgid: 0}
+}