mirror of
https://github.com/go-gost/x.git
synced 2026-10-20 19:25:36 +00:00
Add Command []string to PluginConfig and a new x/plugin package that spawns plugin subprocesses (deduplicated by argv) and terminates them on Shutdown. Linux uses Pdeathsig, Windows a kill-on-close job object, so children follow an abrupt parent exit. Wire Spawn into every config/parsing plugin constructor.
13 lines
330 B
Go
13 lines
330 B
Go
//go:build !linux && !windows
|
|
|
|
package plugin
|
|
|
|
import "os/exec"
|
|
|
|
// prepare and attach are no-ops on platforms without a parent-side mechanism
|
|
// to terminate the child on parent death. Children spawned here will not
|
|
// follow an abrupt parent exit (panic / kill -9).
|
|
func prepare(cmd *exec.Cmd) {}
|
|
|
|
func attach(cmd *exec.Cmd) {}
|