lxc-attach does not output stderr any more if stdout is redirected
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
With lxc 2.0.0~rc5-0ubuntu1 the autopkgtest LXC runner is still broken (even with bug 1551960 fixed) when stderr is a terminal:
$ adt-run gzip --- lxc -s adt-wily
[...]
adt-run [10:15:45]: ERROR: erroneous package: got 10 lines of results from extract where 4 expected:
gpgv: Signature made Mon 27 Oct 2014 09:48:46 AM CET using RSA key ID BD4CA59E
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./gzip_
Get:1 http://
Get:2 http://
Get:3 http://
/tmp/adt-
gzip
1.6-4ubuntu1
1
Thie first couple of lines are supposed to go to stderr, not stdout. This works if stderr is not a terminal, but a pipe, with e. g. "adt-run -l /dev/null gzip --- lxc -s adt-wily" (where stderr is sent to a pipe which gets tee'ed to both the log file and the real stderr).
This is probably a regression in LXC, and it doesn't happen with older LXC nor LXD nor any other backend. But it might also be some intentional change which autopkgtest needs to be adjusted to, so for now I keep tasks for both projects.
Changed in autopkgtest (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in lxc (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in lxc (Ubuntu): | |
status: | Fix Committed → Fix Released |
no longer affects: | autopkgtest (Ubuntu) |
This is indeed a regression in lxc-attach. Until 2.0.0~rc1 this DTRT:
$ sudo lxc-attach -n adt-virt-lxc-lbmmpf -- sh -c 'echo ERR>&2' >/dev/null
ERR
but not any more with rc5:
$ sudo lxc-attach -n a -- sh -c 'echo ERR>&2' >/dev/null
# (no output)