From 7965bf54048044d63f967d2b4ce8efe1e1072f05 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 5 Jun 2018 10:11:03 +0200 Subject: podman-varlink: log timeouts The default timeout of one second when using podman-varlink can confuse users as podman exits in silence after this timeout in case no connection to the endpoint is alive. Print a log (info level) that the varlink service has expired to guide the user. This change requires to vendor in the latest master of varlink/go. Signed-off-by: Valentin Rothberg Closes: #899 Approved by: rhatdan --- cmd/podman/varlink.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmd/podman/varlink.go') diff --git a/cmd/podman/varlink.go b/cmd/podman/varlink.go index 300b5ebe4..ca3159460 100644 --- a/cmd/podman/varlink.go +++ b/cmd/podman/varlink.go @@ -7,6 +7,7 @@ import ( ioprojectatomicpodman "github.com/projectatomic/libpod/cmd/podman/varlink" "github.com/projectatomic/libpod/pkg/varlinkapi" "github.com/projectatomic/libpod/version" + "github.com/sirupsen/logrus" "github.com/urfave/cli" "github.com/varlink/go/varlink" ) @@ -62,7 +63,13 @@ func varlinkCmd(c *cli.Context) error { // Run the varlink server at the given address if err = service.Listen(args[0], timeout); err != nil { - return errors.Errorf("unable to start varlink service") + switch err.(type) { + case varlink.ServiceTimeoutError: + logrus.Infof("varlink service expired (use --timeout to increase session time beyond %d ms)", c.Int64("timeout")) + return nil + default: + return errors.Errorf("unable to start varlink service") + } } return nil -- cgit v1.2.3-54-g00ecf