You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
runtime: Replace '--console-socket PATH' with '$LISTEN_FDS + 3'
As Michael requested [1]. The upsides of this approach are:
* No need to drop the console onto the filesystem. You can use
socketpair(2) in the runtime caller and be done with it.
* No need for the runtime to connect (since the connection is already
open when 'create' is invoked). This allows you to use
SOCK_SEQPACKET or SOCK_STREAM as you see fit.
The downsides are:
* Overloading $LISTEN_FDS. Using a positional-argument approach to
pass the FD number would feel less magical and make me much happier.
[1]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-10-19-21.00.log.html#l-30
Signed-off-by: W. Trevor King <[email protected]>
Copy file name to clipboardExpand all lines: runtime.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,6 @@ For example, POSIX systems define [`LANG` and related environment variables][pos
42
42
**Options*
43
43
**`--bundle <PATH>`* Override the path to the [bundle directory][bundle] (defaults to the current working directory).
44
44
**`--pid-file <PATH>`* The runtime MUST write the container PID to this path.
45
-
**`--console-socket <PATH>`* The runtime MUST pass the [pseudoterminal master][posix_openpt.3] through the socket at `<PATH>`; the protocol is [described below](#console-socket).
46
45
**Standard streams:*
47
46
* If [`process.terminal`][process] is true:
48
47
* *stdin:* The runtime MUST NOT attempt to read from its stdin.
@@ -60,14 +59,17 @@ For example, POSIX systems define [`LANG` and related environment variables][pos
60
59
**Environment variables*
61
60
**`LISTEN_FDS`:* The number of file descriptors passed.
62
61
For example, `LISTEN_FDS=2` would mean that the runtime MUST pass file descriptors 3 and 4 to the container process (in addition to the standard streams) to support [socket activation][systemd-listen-fds].
62
+
**Additional file descriptors*
63
+
* If [`process.terminal`][process] is true, the caller MUST provide an open [`AF_UNIX` socket][unix-socket] on file descriptor `$LISTEN_FDS + 3`.
64
+
The runtime MUST pass the [pseudoterminal master][posix_openpt.3] through the socket; the protocol is [described below](#console-socket).
63
65
**Exit code:* Zero if the container was successfully created and non-zero on errors.
64
66
65
67
Callers MAY block on this command's successful exit to trigger post-create activity.
66
68
67
69
#### Console socket
68
70
69
-
The [`AF_UNIX`][unix-socket] used by [`--console-socket`](#create) handles request and response messages between a runtime and server.
70
-
The socket type MUST be [`SOCK_SEQPACKET`][socket-types].
71
+
The [`AF_UNIX`][unix-socket] used by the [`$LISTEN_FDS + 3` socket](#create) handles request and response messages between a runtime and server.
72
+
The socket type MUST be [`SOCK_SEQPACKET`][socket-types] or [`SOCK_STREAM`][socket-types].
71
73
The server MUST send a single response for each runtime request.
72
74
The [normal data][socket-queue] ([`msghdr.msg_iov*`][socket.h]) of all messages MUST be [UTF-8][][JSON](glossary.md#json).
0 commit comments