Use a temp socket to receive the console from runc

This greatly reduce the risk that we will hit the unix socket maximum path
length.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-03 10:44:10 -07:00
parent 0fa76584f8
commit fbe4751b83
2 changed files with 4 additions and 5 deletions

View File

@@ -117,10 +117,10 @@ func newInitProcess(context context.Context, plat platform, path, namespace stri
io runc.IO
)
if r.Terminal {
if socket, err = runc.NewConsoleSocket(filepath.Join(path, "pty.sock")); err != nil {
if socket, err = runc.NewTempConsoleSocket(); err != nil {
return nil, errors.Wrap(err, "failed to create OCI runtime console socket")
}
defer os.Remove(socket.Path())
defer socket.Close()
} else {
if io, err = runc.NewPipeIO(0, 0); err != nil {
return nil, errors.Wrap(err, "failed to create OCI runtime io pipes")