From 4e0326241b35d2549fdba5666f343c31279e18e4 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 17 Apr 2020 16:27:17 -0700 Subject: V2 Fix support for tcp://[::] connections * Fix support for socket activation, on remote and service $ systemd-socket-activate -l 8083 --fdname=podman bin/podman system service --log-level=debug --time=30 $ bin/podman-remote --remote=tcp://[::]:8083 image ls Or, use the podman.{socket,service} unit files $ bin/podman-remote --remote=unix:///run/podman/podman.sock image ls Signed-off-by: Jhon Honce --- pkg/api/server/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg/api') diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go index 5f1a86183..9576fd437 100644 --- a/pkg/api/server/server.go +++ b/pkg/api/server/server.go @@ -51,7 +51,7 @@ func NewServerWithSettings(runtime *libpod.Runtime, duration time.Duration, list func newServer(runtime *libpod.Runtime, duration time.Duration, listener *net.Listener) (*APIServer, error) { // If listener not provided try socket activation protocol if listener == nil { - if _, found := os.LookupEnv("LISTEN_FDS"); !found { + if _, found := os.LookupEnv("LISTEN_PID"); !found { return nil, errors.Errorf("Cannot create API Server, no listener provided and socket activation protocol is not active.") } @@ -125,7 +125,7 @@ func newServer(runtime *libpod.Runtime, duration time.Duration, listener *net.Li if err != nil { methods = []string{""} } - logrus.Debugf("Methods: %s Path: %s", strings.Join(methods, ", "), path) + logrus.Debugf("Methods: %6s Path: %s", strings.Join(methods, ", "), path) return nil }) } @@ -179,6 +179,7 @@ func (s *APIServer) Shutdown() error { } // Gracefully shutdown server, duration of wait same as idle window + // TODO: Should we really wait the idle window for shutdown? ctx, cancel := context.WithTimeout(context.Background(), s.idleTracker.Duration) defer cancel() go func() { -- cgit v1.2.3-54-g00ecf