aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/varlink.go
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@suse.com>2018-06-05 10:11:03 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-05 17:03:58 +0000
commit7965bf54048044d63f967d2b4ce8efe1e1072f05 (patch)
treeda8658704c91567ab2f0e7096a9c71870c3617c9 /cmd/podman/varlink.go
parent03cf4ac60af463cd82af65fd5846fdea1c3e7e62 (diff)
downloadpodman-7965bf54048044d63f967d2b4ce8efe1e1072f05.tar.gz
podman-7965bf54048044d63f967d2b4ce8efe1e1072f05.tar.bz2
podman-7965bf54048044d63f967d2b4ce8efe1e1072f05.zip
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 <vrothberg@suse.com> Closes: #899 Approved by: rhatdan
Diffstat (limited to 'cmd/podman/varlink.go')
-rw-r--r--cmd/podman/varlink.go9
1 files changed, 8 insertions, 1 deletions
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