mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
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:
@@ -101,7 +101,8 @@ following will output a list of processes running in the container:
|
||||
if err == nil {
|
||||
os.Exit(status)
|
||||
}
|
||||
return fmt.Errorf("exec failed: %w", err)
|
||||
fatalWithCode(fmt.Errorf("exec failed: %w", err), 255)
|
||||
return nil // to satisfy the linter
|
||||
},
|
||||
SkipArgReorder: true,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user