runc exec: fail with exit code of 255

Currently there's no way to distinguish between the two cases:
 - runc exec failed;
 - the command executed returned 1.

This was possible before commit 8477638aab, as runc exec exited with
the code of 255 if exec itself has failed. The code of 255 is the same
convention as used by e.g. ssh.

Re-introduce the feature, document it, and add some tests so it won't be
broken again.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-07-07 18:08:52 -07:00
parent 1f5f237b37
commit 60e02b4b25
4 changed files with 33 additions and 3 deletions
+5
View File
@@ -59,6 +59,11 @@ multiple times.
: Pass _N_ additional file descriptors to the container (**stdio** +
**$LISTEN_FDS** + _N_ in total). Default is **0**.
# EXIT STATUS
Exits with a status of _command_ (unless **-d** is used), or **255** if
an error occurred.
# EXAMPLES
If the container can run **ps**(1) command, the following
will output a list of processes running in the container: