exec: use exit code 255 for exec failures, same paused error as runc - #2245
Merged
Merged
Conversation
On success, crun exec exits with the exit code of the executed process. On failure of crun exec itself (e.g. no such container, no such executable), it exits with 1, and so the caller cannot tell it apart from the executed process exiting with 1. Use exit code of 255 for crun exec failures, like runc does since v1.1.0 (see opencontainers/runc#3073), which is the same convention as used by e.g. ssh. Note that podman (via conmon) does not rely on crun exec exit code, as it gets the error details from conmon. Found by the "runc exec [exit codes]" runc integration test. Signed-off-by: Kir Kolyshkin <[email protected]>
When the container is paused, crun exec fails with the container `ID` is paused while runc uses cannot exec in a paused container Use the latter (appending the container ID), as some tools and tests (e.g. "runc exec should refuse a paused container" runc integration test) check for it. Signed-off-by: Kir Kolyshkin <[email protected]>
kolyshkin
force-pushed
the
exec-exit-code-255
branch
from
September 11, 2026 05:34
a19ff22 to
0f38eff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
exec: use exit code 255 for exec failures
On success,
crun execexits with the exit code of the executed process. On failure ofcrun execitself (e.g. no such container, no such executable), it exits with 1, and so the caller cannot tell it apart from the executed process exiting with 1.Use exit code of 255 for
crun execfailures, like runc does since v1.1.0 (see runc exec: fail with exit code of 255 opencontainers/runc#3073), which is the same convention as used by e.g. ssh. Add a test case.Note that podman (via conmon) does not rely on the
crun execexit code, as it gets the error details from conmon.exec: use the same paused container error as runc
When the container is paused,
crun execfails withthe container `ID` is paused, while runc usescannot exec in a paused container. Use the latter (appending the container ID), as some tools and tests check for it.Found by the "runc exec [exit codes]" and "runc exec should refuse a paused container" runc integration tests (see #2238).