lxd icon indicating copy to clipboard operation
lxd copied to clipboard

lxc exec: command output is incorrect if interactive mode is enforced

Open dmitry-lyfar opened this issue 2 years ago • 4 comments

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

  1. Send a text file to the command's stdin and enforce interactive mode lxc exec -t u1 -- tee < ./go.mod
  2. 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.

dmitry-lyfar avatar Sep 20 '23 22:09 dmitry-lyfar

@MusicDin I've assigned this to you as you're working on https://github.com/canonical/lxd/issues/12210 and this could be related.

tomponline avatar Sep 21 '23 07:09 tomponline

@dmitry-lyfar btw what is your use case for forcing interactive mode in this case?

tomponline avatar Sep 21 '23 07:09 tomponline

@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 avatar Sep 21 '23 07:09 dmitry-lyfar

@dmitry-lyfar ah ok good, so its not blocking you. Thanks

tomponline avatar Sep 21 '23 07:09 tomponline