From: Phillip Susi <psusi@ubuntu.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: script input redirection / eof handling
Date: Mon, 02 Dec 2013 09:45:19 -0500 [thread overview]
Message-ID: <529C9CFF.5030709@ubuntu.com> (raw)
In-Reply-To: <20131202125421.GF5572@x2.net.home>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/2/2013 7:54 AM, Karel Zak wrote:
> Note, that if you want to support this scenario (stdin is not a
> terminal) then send a patch ;-)
It seems to work fine up until it hits eof, which can also happen on a
tty and you'll get the same bad behavior, so I think refusing to run
on a non tty isn't a proper fix.
>> Yep, I think it would be enough to add
>>
>> kill(0, SIGTERM);
>>
>> before done() in doinput() to avoid orphans.
You don't want to just make sure the children die, you want to make
sure that the child sees the eof and capture any final output it may have.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJSnJz9AAoJEI5FoCIzSKrw6j0IAKZvkym0kJQfWghombuTnV1z
5FCcWPz3Jyo9V96X+fnD3cXpkkPjIM5ZUIBaRJubUYX65AKebXaXw+FkE9YyXsIR
Jeegewp5IlSlF3zbZzCSUchI/gK0KCHv1yKe21xD20iGAy9MGApXBJszsOaREbU2
nG9mFYwviFDQnURBfwHxvS7Bf4S+6i1wgKeS58EqSeXpMpMDCimTw1/mv8MLnGdS
0nzCrPZvgRZcc2avYPSWYs8ZLtFgu5rDuJ7J9TfEuiEzGWCqlPXQYF1a6nHvpT0W
KSdu+1bzsasdrEXFF6Iai2NvFndg9JXqiLCGfKdELbJayYPjwltOtl41PfalG/w=
=2lT4
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2013-12-02 14:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 14:21 script input redirection / eof handling Phillip Susi
2013-12-02 12:36 ` Karel Zak
2013-12-02 12:54 ` Karel Zak
2013-12-02 14:45 ` Phillip Susi [this message]
2013-12-02 17:02 ` Karel Zak
2013-12-02 18:06 ` Phillip Susi
2013-12-02 22:36 ` Karel Zak
2013-12-02 23:25 ` Karel Zak
2013-12-03 12:55 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=529C9CFF.5030709@ubuntu.com \
--to=psusi@ubuntu.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox