Commit 84a6e9fe authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Gack, must call "select STDOUT" after the reopen operation, since we

used "select STDERR" to change the line buffering. The result was that
after the log roll, the child was printing to STDERR instead of
STDOUT, and so the parent never saw any new events.

Note that USR1 (re-exec binary) does not work since exec bypasses the
END block, and things get messed up. Not fixed yet.
parent 8f0551fc
......@@ -1825,9 +1825,12 @@ sub StartEvents()
print STDERR "Caught a USR2 in child\n";
# Only STDERR can be redirected to the newfile. STDOUT is writing
# to the parent process.
close(STDERR);
open(STDERR, ">> $LOGFILE") or fatal("reopening $LOGFILE: $!");
select STDERR;
$OUTPUT_AUTOFLUSH = 1;
# restore default output.
select STDOUT;
print STDERR "Opened new logfile in child\n";
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment