Gentoo Archives: gentoo-dev

From: Jason Stubbs <jstubbs@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [Bug 104705] emerge doesn't print complete error message
Date: Mon, 24 Oct 2005 07:09:25
Message-Id: 200510231713.23621.jstubbs@gentoo.org
1 On Sunday 23 October 2005 15:45, Jason Stubbs wrote:
2 > One question; is the waitpid(x,0) necessary in the case where SIGKILL
3 > wasn't sent? Is waitpid(x,os.NOHANG) enough to clean up the zombie when
4 > SIGTERM succeeds? If so, the waitpid(x,0) could be indented into the "if
5 > not timeout:" block.
6
7 In my finding that the previous patch doesn't work and where the problem was I
8 found that waitpid(x,os.NOHANG) is enough. I further found that the except
9 block could be removed if the waitpid(x,os.NOHANG)[1] == 0 check is
10 effectively changed to waitpid(x,os.NOHANG) == (0,0).
11
12 Anyway, it seems that tee doesn't dump its remaining buffer when it receives a
13 SIGTERM. This patch adds a 0.5 second wait before sending the SIGTERM and a
14 0.5 second wait between the SIGTERM and the SIGKILL. The process status is
15 checked every 0.01 seconds so the waiting is essentially transparent.
16
17 P.S. Are the mailing lists slow or have I been kicked off (and thus will never
18 receive an answer) ?
19 --
20 Jason Stubbs

Attachments

File name MIME type
sigterm-timeout.patch text/x-diff

Replies