summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2019-09-12 16:06:44 -0400
committerPeter Hunt <pehunt@redhat.com>2019-09-12 16:14:30 -0400
commit1dcb771dbd63e7ee883e400da4a8e3295cfb6666 (patch)
tree0411f30bc09189db0e047390450b1772719740a4 /libpod
parentaf8fedcc78674d71d43ca3000438c42b7b6b6994 (diff)
downloadpodman-1dcb771dbd63e7ee883e400da4a8e3295cfb6666.tar.gz
podman-1dcb771dbd63e7ee883e400da4a8e3295cfb6666.tar.bz2
podman-1dcb771dbd63e7ee883e400da4a8e3295cfb6666.zip
exec: Register resize func a bit later
if we register the resize func too early, it attempts to read from the 'ctl' file before it exists. this causes the func to error, and the resize to not go through. Fix this by registering resize func later for conmon. This, along with a conmon fix, will allow exec to know the terminal size at startup Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/oci_attach_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/oci_attach_linux.go b/libpod/oci_attach_linux.go
index 22afa7416..6cada0801 100644
--- a/libpod/oci_attach_linux.go
+++ b/libpod/oci_attach_linux.go
@@ -107,8 +107,6 @@ func (c *Container) attachToExec(streams *AttachStreams, keys string, resize <-c
logrus.Debugf("Attaching to container %s exec session %s", c.ID(), sessionID)
- registerResizeFunc(resize, c.execBundlePath(sessionID))
-
// set up the socket path, such that it is the correct length and location for exec
socketPath := buildSocketPath(c.execAttachSocketPath(sessionID))
@@ -116,6 +114,7 @@ func (c *Container) attachToExec(streams *AttachStreams, keys string, resize <-c
if _, err := readConmonPipeData(attachFd, ""); err != nil {
return err
}
+
// 2: then attach
conn, err := net.DialUnix("unixpacket", nil, &net.UnixAddr{Name: socketPath, Net: "unixpacket"})
if err != nil {
@@ -127,6 +126,10 @@ func (c *Container) attachToExec(streams *AttachStreams, keys string, resize <-c
}
}()
+ // Register the resize func after we've read the attach socket, as we know at this point the
+ // 'ctl' file has been created in conmon
+ registerResizeFunc(resize, c.execBundlePath(sessionID))
+
// start listening on stdio of the process
receiveStdoutError, stdinDone := setupStdioChannels(streams, conn, detachKeys)