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

pull/2682/head sdk/v0.0.27
Jeff Mitchell 4 years ago committed by GitHub
parent b6c0ccc1e8
commit b8a3def368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save