add pdeathsig
This commit is contained in:
parent
b45652b305
commit
0ebe1e19d5
3 changed files with 21 additions and 0 deletions
8
cmd/sshpiperd/cmd_dummy.go
Normal file
8
cmd/sshpiperd/cmd_dummy.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//go:build !linux
|
||||
|
||||
package main
|
||||
|
||||
import "os/exec"
|
||||
|
||||
func setPdeathsig(cmd *exec.Cmd) {
|
||||
}
|
||||
12
cmd/sshpiperd/cmd_linux.go
Normal file
12
cmd/sshpiperd/cmd_linux.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//go:build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func setPdeathsig(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}
|
||||
}
|
||||
|
|
@ -59,6 +59,7 @@ func createPlugin(args []string) (*plugin.GrpcPlugin, error) {
|
|||
default:
|
||||
cmd := exec.Command(exe)
|
||||
cmd.Args = args
|
||||
setPdeathsig(cmd)
|
||||
|
||||
log.Info("starting child process plugin: ", cmd.Args)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue