lxc-attach does not work any more with input redirection

Bug #1551960 reported by Martin Pitt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

LXC 2.0.0~rc{2,3,4} break autopkgtest's LXC runner. Downgrading to 2.0.0~rc1 works again. The issue is that lxc-attach stops working properly with input redirection.

# lxc-start -n a

Until 2.0.0~rc1 I could redirect lxc-attach's stdout:
# lxc-attach -n a runlevel </dev/null 2>/dev/null |cat
N 5

But now this does not work any more:
# lxc-attach -n a runlevel
N 5
# lxc-attach -n a runlevel </dev/null
lxc-attach: console.c: lxc_console_cb_tty_master: 683 Bad file descriptor - failed to write
# lxc-attach -n a runlevel </dev/null 2>/dev/null
# lxc-attach -n a runlevel </dev/null 2>/dev/null | cat
#

I. e. the last two commands don't have any output at all any more.

Martin Pitt (pitti)
Changed in autopkgtest (Ubuntu):
importance: Undecided → High
tags: added: regression-release xenial
Revision history for this message
Christian Brauner (cbrauner) wrote :

Martin, can you please try with a fresh build from current lxc master and report if the error still persists?

Revision history for this message
Christian Brauner (cbrauner) wrote :

Nevermind. You have the newest version.

Revision history for this message
Christian Brauner (cbrauner) wrote :

Fix present as pr on github against lxc master. Should be committed soon.

Changed in lxc (Ubuntu):
status: New → Confirmed
Changed in lxc (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

I locally applied https://github.com/lxc/lxc/commit/12752e2 to our current package and built it. Now it looks better:

# lxc-attach -n a runlevel
N 5
# lxc-attach -n a runlevel </dev/null
N 5
# lxc-attach -n a runlevel </dev/null 2>/dev/null
N 5
# lxc-attach -n a runlevel </dev/null 2>/dev/null | cat

So redirecting stdin only now does not show this "lxc_console_cb_tty_master: 683 Bad file" error any more, and redirecting stderr now works too. But redirecting stdout in addition still doesn't?

Maybe I'm missing another fix from trunk, though.

Revision history for this message
Martin Pitt (pitti) wrote :

Nevermind, I built upstream git master, and that lxc-attach works fine. Thanks Christian!

Revision history for this message
Martin Pitt (pitti) wrote :

With that fix applied the adt-virt-lxc tests work fine again, so removing the autopkgtest task again (I added it in case I need to adjust something to the new LXC in that regard).

no longer affects: autopkgtest (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 2.0.0~rc5-0ubuntu1

---------------
lxc (2.0.0~rc5-0ubuntu1) xenial; urgency=medium

  * New usptream release (2.0.0~rc5)
    - Fix a number of cgfs issues (LP: #1549363, LP: #1543697, LP: #1552355)
    - Fix attach failing to allocate a tty (LP: #1551960)
    - Fix LXC rebooting the container despite post-stop failure
    - Fix lxc-copy output (LP: #1551935)
    - Documentation, manpagen and manpage translations update
    - Update to the plamo template

 -- Stéphane Graber <email address hidden> Thu, 03 Mar 2016 11:05:25 -0500

Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.