lxc exec: command output is incorrect if interactive mode is enforced
Required information
- Distribution: Ubuntu
- Distribution version: 22.04
- The output of "lxc info" or if that fails:
- Kernel version: 5.19.0-50-generic
- LXC version: 5.0.0~git2209-g5a7b9ce67
- LXD version: lxd git-fd28846 25670 latest/edge
- Storage backend in use: dir
Issue description
If -t option is used to enforce the interactive mode, exec produces incorrect output and may hang at the end of execution instead of returning.
Steps to reproduce
- Send a text file to the command's stdin and enforce interactive mode
lxc exec -t u1 -- tee < ./go.mod - The output is produced twice (i.e. I get the file contents printed twice) and exec never returns. Possibly, there are other incorrect outcomes here.
@MusicDin I've assigned this to you as you're working on https://github.com/canonical/lxd/issues/12210 and this could be related.
@dmitry-lyfar btw what is your use case for forcing interactive mode in this case?
@tomponline there is no real use case so far; it is something I have been testing as one of the use cases for the LXD exec API in workspace.
@dmitry-lyfar ah ok good, so its not blocking you. Thanks