aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/server/server.go10
-rw-r--r--pkg/domain/infra/abi/terminal/sigproxy_linux.go5
2 files changed, 9 insertions, 6 deletions
diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go
index cc5b45a65..24ad1874b 100644
--- a/pkg/api/server/server.go
+++ b/pkg/api/server/server.go
@@ -190,6 +190,9 @@ func (s *APIServer) Serve() error {
}); err != nil {
return err
}
+ // Unregister the libpod handler, which just calls exit(1).
+ // Ignore errors if it doesn't exist.
+ _ = shutdown.Unregister("libpod")
errChan := make(chan error, 1)
@@ -226,12 +229,7 @@ func (s *APIServer) Serve() error {
errChan <- nil
}()
- select {
- case err := <-errChan:
- return err
- }
-
- return nil
+ return <-errChan
}
// Shutdown is a clean shutdown waiting on existing clients
diff --git a/pkg/domain/infra/abi/terminal/sigproxy_linux.go b/pkg/domain/infra/abi/terminal/sigproxy_linux.go
index f484e926c..0c586cf5c 100644
--- a/pkg/domain/infra/abi/terminal/sigproxy_linux.go
+++ b/pkg/domain/infra/abi/terminal/sigproxy_linux.go
@@ -5,12 +5,17 @@ import (
"syscall"
"github.com/containers/podman/v2/libpod"
+ "github.com/containers/podman/v2/libpod/shutdown"
"github.com/containers/podman/v2/pkg/signal"
"github.com/sirupsen/logrus"
)
// ProxySignals ...
func ProxySignals(ctr *libpod.Container) {
+ // Stop catching the shutdown signals (SIGINT, SIGTERM) - they're going
+ // to the container now.
+ shutdown.Stop()
+
sigBuffer := make(chan os.Signal, 128)
signal.CatchAll(sigBuffer)