Skip to content

Commit 26440a5

Browse files
committed
runtime: Replace '$LISTEN_FDS + 3' with '--console-socket FD'
This bridges the gap between my original '--console-socket PATH' proposal from 15350b3 (runtime: Add --console-socket for terminal handling, 2017-02-08) and Michael's approach from baa2412 (runtime: Replace '--console-socket PATH' with '$LISTEN_FDS + 3', 2017-02-08). All of the benefits of not needing an on-disk socket, and none of the magic of overloading $LISTEN_FDS. I don't know why Michael didn't like this approach as much [1], but it feels a lot better to me. [1]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-10-19-21.00.log.html#l-31 Signed-off-by: W. Trevor King <[email protected]>
1 parent a26d73b commit 26440a5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

runtime.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ For example, POSIX systems define [`LANG` and related environment variables][pos
4141
* *`<ID>`* Set the container ID to create.
4242
* *Options*
4343
* *`--bundle <PATH>`* Override the path to the [bundle directory][bundle] (defaults to the current working directory).
44+
* *`--console-socket <FD>`* The runtime MUST pass the [pseudoterminal master][posix_openpt.3] through the open socket at file descriptor `<FD>`; the protocol is [described below](#console-socket).
4445
* *`--pid-file <PATH>`* The runtime MUST write the container PID to this path.
4546
* *Standard streams:*
4647
* If [`process.terminal`][process] is true:
@@ -59,16 +60,13 @@ For example, POSIX systems define [`LANG` and related environment variables][pos
5960
* *Environment variables*
6061
* *`LISTEN_FDS`:* The number of file descriptors passed.
6162
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).
6563
* *Exit code:* Zero if the container was successfully created and non-zero on errors.
6664

6765
Callers MAY block on this command's successful exit to trigger post-create activity.
6866

6967
#### Console socket
7068

71-
The [`AF_UNIX`][unix-socket] used by the [`$LISTEN_FDS + 3` socket](#create) handles request and response messages between a runtime and server.
69+
The [`AF_UNIX`][unix-socket] used by [`--console-socket`](#create) handles request and response messages between a runtime and server.
7270
The socket type MUST be [`SOCK_SEQPACKET`][socket-types] or [`SOCK_STREAM`][socket-types].
7371
The server MUST send a single response for each runtime request.
7472
The [normal data][socket-queue] ([`msghdr.msg_iov*`][socket.h]) of all messages MUST be [UTF-8][] [JSON](glossary.md#json).

0 commit comments

Comments
 (0)