containers / krunvm

Create microVMs from OCI images
Apache License 2.0
1.41k stars 42 forks source link

Return code from command not returned by krunvm #21

Open c3d opened 2 years ago

c3d commented 2 years ago

I noticed that because of #20:

% krunvm start fedora-rawhide  /bin/ls -- -l /bin/false
-rwxr-xr-x 1 root root 69808 Aug  1 15:36 /bin/false
% krunvm start fedora-rawhide  /bin/false
% echo $?
0

The expected returned value would be 1, since that's what /bin/false returns.

This may make it difficult to use krunvm in scripts. For example, I could not write a host script that does a build and test whether the build succeeded.

slp commented 2 years ago

This is actually a libkrun issue, related to https://github.com/containers/libkrun/issues/10. A interface needs to be designed to transport that information between the host and the guest in a way that doesn't require the intervention of a dedicated agent.