Bug 70622 - [systemd-nspawn] stdin not reset from nonblocking mode
Summary: [systemd-nspawn] stdin not reset from nonblocking mode
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 15:13 UTC by MMH
Modified: 2014-02-21 17:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Script to reproduce bug (215 bytes, text/plain)
2013-10-18 15:13 UTC, MMH
Details

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.