1
0
mirror of https://github.com/opencontainers/runtime-spec.git synced 2026-02-05 18:45:18 +01:00
Files
runtime-spec/runtime-linux.md
W. Trevor King 3aa9eb8b65 runtime-linux: Condition /proc/self/fd symlinks on source existence
Since 279c3c09 (linux: relax filesystem requirements for container,
2017-01-23, #666) it's no longer guaranteed that /proc will exist.
And there doesn't seem to be much point in requiring symlinks which
will be known broken.

This commit also tightens the timing.  Before it was just "after the
container has `/proc` mounted", which could have happened during the
'delete' operation (if the container authors wanted to be especially
ornery).  With this commit, I've put the creation in step 2 of the
lifecycle.  And within step 2, it happens after 'mounts' has been
processed.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-03-16 15:20:32 -07:00

1.0 KiB

Linux Runtime

File descriptors

By default, only the stdin, stdout and stderr file descriptors are kept open for the application by the runtime. The runtime MAY pass additional file descriptors to the application to support features such as socket activation. Some of the file descriptors MAY be redirected to /dev/null even though they are open.

While creating the container (step 2 in the lifecycle), runtimes MUST create the following symlinks if the source file exists after processing mounts:

Source Destination
/proc/self/fd /dev/fd
/proc/self/fd/0 /dev/stdin
/proc/self/fd/1 /dev/stdout
/proc/self/fd/2 /dev/stderr