Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions runtime-linux.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# 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](http://0pointer.de/blog/projects/socket-activated-containers.html).
Some of the file descriptors MAY be redirected to `/dev/null` even though they are open.

## Dev symbolic links

The runtime may pass additional file descriptors to the application to support features such as [socket activation](http://0pointer.de/blog/projects/socket-activated-containers.html).
After the container has `/proc` mounted, the following standard symlinks MUST be setup within `/dev/` for the io.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend wording like the existing “MUST be made available” or “MUST … supply” instead of “MUST be setup”. Config authors and runtime callers should only care about the links being there, and shouldn't care about whether it was the runtime that set them up. And runtimes that bind-mount /dev (or similar) into the container may already have these links and not need to create them themselves. I'd also like to make the timing for these required objects explicit (see the third bullet here). And cross-links between these “paths the runtime must setup if missing” sections would be good too.


Some of the file descriptors may be redirected to `/dev/null` even though they are open.
| Source | Destination |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ln(1) calls these “target” and “link name” respectively.

| --------------- | ----------- |
| /proc/self/fd | /dev/fd |
| /proc/self/fd/0 | /dev/stdin |
| /proc/self/fd/1 | /dev/stdout |
| /proc/self/fd/2 | /dev/stderr |