Commented on the bug due to reasoning behind this patch. Essentially, SIGTERM is sent to "tee", a WNOHANG waitpid() is performed followed by SIGKILL if it hasn't exited. So if tee doesn't exit immediately upon getting the SIGTERM, its buffers won't get a chance to get to disk due to it being killed. This patch simply adds a 1 second window between the SIGTERM and the SIGKILL. One question; is the waitpid(x,0) necessary in the case where SIGKILL wasn't sent? Is waitpid(x,os.NOHANG) enough to clean up the zombie when SIGTERM succeeds? If so, the waitpid(x,0) could be indented into the "if not timeout:" block. -- Jason Stubbs