Previously, long lived CLI plugin processes weren't properly handled (see: https://github.com/docker/cli/issues/4402) resulting in plugin processes being left behind running, after the CLI process exits. This commit changes the plugin handling code to open an abstract unix socket before running the plugin and passing it to the plugin process, and changes the signal handling on the CLI side to close this socket which tells the plugin that it should exit. This implementation makes use of sockets instead of simply setting PDEATHSIG on the plugin process so that it will work on both BSDs, assorted UNIXes and Windows. Signed-off-by: Laura Brehm <laurabrehm@hey.com>
15 lines
263 B
Go
15 lines
263 B
Go
//go:build unix
|
|
// +build unix
|
|
|
|
package signals
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// TerminationSignals represents the list of signals we
|
|
// want to special-case handle, on this platform.
|
|
var TerminationSignals = []os.Signal{unix.SIGTERM, unix.SIGINT}
|