From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: util-linux-owner@vger.kernel.org Received: from auth.b.painless.aa.net.uk ([90.155.4.48]:51986 "EHLO auth.b.painless.aa.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752790AbaJILYU (ORCPT ); Thu, 9 Oct 2014 07:24:20 -0400 From: Adam Sampson To: Thorsten Glaser Cc: util-linux@vger.kernel.org Subject: Re: script from 2.25.1 may be broken (hangs) References: Date: Thu, 09 Oct 2014 11:53:15 +0100 In-Reply-To: (Thorsten Glaser's message of "Wed, 8 Oct 2014 22:25:38 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: util-linux-owner@vger.kernel.org List-ID: Thorsten Glaser writes: > $ script -qc './test.sh -v' &1 | tee log For me, this doesn't hang, but it does exit before test.sh is actually finished. Here's a simpler example that does the same thing: $ cat simpler.sh #!/bin/sh echo one sleep 2 echo two $ script -c './simpler.sh' Script started, file is typescript one two Script done, file is typescript $ script -c './simpler.sh' 21180 <... write resumed> ) = 1 21180 poll([{fd=4, events=POLLIN}], 1, 100 21180 <... poll resumed> ) = 1 ([{fd=4, revents=POLLIN}]) 21180 poll([{fd=4, events=POLLIN}], 1, 100) = 1 ([{fd=4, revents=POLLIN}]) 21180 poll([{fd=4, events=POLLIN}], 1, 100) = 1 ([{fd=4, revents=POLLIN}]) 21180 poll([{fd=4, events=POLLIN}], 1, 100 [lots more poll calls while other stuff happens in child processes] 21180 <... poll resumed> ) = 0 (Timeout) 21180 wait4(-1, 0x7fff47830c54, WNOHANG, NULL) = 0 21180 kill(21181, SIGTERM) = 0 But at this point the child is still running. So it looks like doinput isn't waiting for the child to exit correctly, when stdin has hit EOF before the child has finished. Thanks, -- Adam Sampson