Bug 70622

Summary: [systemd-nspawn] stdin not reset from nonblocking mode
Product: systemd Reporter: MMH <freedesktop>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: major    
Priority: medium CC: freedesktop
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Script to reproduce bug

Description MMH 2013-10-18 15:13:53 UTC
Created attachment 87825 [details]
Script to reproduce bug

It seems stdin is set to blocking mode somewhere and is not reset before termination[1].

I ran into this when I used the 'read' function after calling arch-nspawn[2] which uses systemd-nspawn.

[1] http://stackoverflow.com/questions/16402363/read-fails-after-tcpreplay-with-error-0-resource-temporarily-unavailabl
[2] https://projects.archlinux.org/devtools.git/tree/arch-nspawn.in
Comment 1 MMH 2013-10-18 15:17:07 UTC
Using zsh instead of bash works for scripting.
Apparently zsh resets the stdin itself after the invokation of systemd-nspawn.
Comment 2 Lennart Poettering 2014-02-21 17:06:12 UTC
Fixed in git.

I am pretty sure though that this should be fixed in bash, too, for robustness reasons. They really should turn off non-blocking mode again, before reading from stdin...
Comment 3 Lennart Poettering 2014-02-21 17:10:00 UTC
I filed this bug to rhbz regarding bash:

https://bugzilla.redhat.com/show_bug.cgi?id=1068697

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.