krunvm icon indicating copy to clipboard operation
krunvm copied to clipboard

Return code from command not returned by krunvm

Open c3d opened this issue 3 years ago • 1 comments

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.

c3d avatar Aug 04 '22 14:08 c3d

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.

slp avatar Aug 04 '22 21:08 slp