I'm assuming this is supposed to run on process death?  If so, I believe you also need to get at least the output stream for the process (stdin) and close that.