Add SIGHUP ignoring to sdk/plugin (#2677) (#2681)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2022-12-06 15:25:27 -05:00
1 parent b6c0ccc1e8
commit b8a3def368
1 file changed
+12
+12
View File
@@ -3,7 +3,10 @@ package external_host_plugins
import (
"context"
"fmt"
"os"
"os/exec"
"os/signal"
"syscall"
pb "github.com/hashicorp/boundary/sdk/pbs/plugin"
"github.com/hashicorp/go-plugin"
@@ -28,6 +31,15 @@ func ServeHostPlugin(svc pb.HostPluginServiceServer, opt ...Option) error {
if err != nil {
return err
}
signalCh := make(chan os.Signal, 1)
signal.Notify(signalCh, syscall.SIGHUP)
go func() {
for {
<-signalCh
}
}()
hostServiceServer, err := NewHostPluginServiceServer(svc)
if err != nil {
return err