Skip to content

Commit

Permalink
Merge pull request #2985 from kolyshkin/term-doc
Browse files Browse the repository at this point in the history
docs/terminals.md: add troubleshooting
  • Loading branch information
Mrunal Patel authored Jun 3, 2021
2 parents 13acae7 + f99d252 commit c8653a2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/terminals.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,33 @@ interact with pseudo-terminal `stdio`][tty_ioctl(4)].
> means that it is not really possible to uniquely distinguish between `stdout`
> and `stderr` from the caller's perspective.
#### Issues

If you see an error like

```
open /dev/tty: no such device or address
```

from runc, it means it can't open a terminal (because there isn't one). This
can happen when stdin (and possibly also stdout and stderr) are redirected,
or in some environments that lack a tty (such as GitHub Actions runners).

The solution to this is to *not* use a terminal for the container, i.e. have
`terminal: false` in `config.json`. If the container really needs a terminal
(some programs require one), you can provide one, using one of the following
methods.

One way is to use `ssh` with the `-tt` flag. The second `t` forces a terminal
allocation even if there's no local one -- and so it is required when stdin is
not a terminal (some `ssh` implementations only look for a terminal on stdin).

Another way is to run runc under the `script` utility, like this

```console
$ script -e -c 'runc run <container>'
```

[tty_ioctl(4)]: https://linux.die.net/man/4/tty_ioctl

### <a name="pass-through"> Pass-Through ###
Expand Down

0 comments on commit c8653a2

Please sign in to comment.