So that's actually expected behavior though I'll add a flag to force
non-interactive mode.

The way exec works is:
 - If stdin is a tty, use interactive mode
 - If stdin isn't a tty, use non-interactive mode

In interactive mode, a pts device is allocated and used for stdin, stdout and 
stderr, same as an interactive ssh session.
In non-interactive mode, a pipe is allocated for each of stdin, stdout and 
stderr, same as a non-interactive ssh session.

The difference comes from the fact that ssh does know how to
differentiate a shell from another command. LXD doesn't as the command
must always be specified.

So I'll be adding a new --mode option which takes either interactive or
non-interactive and overrides the detection code.

In the mean time, doing the following should work:
    lxc exec x1 -- sh -c 'echo stderr >&2' 2>/dev/null < /dev/null

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1522755

Title:
  lxc exec outputs stderr on host's stdout

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1522755/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to