https://bz.apache.org/bugzilla/show_bug.cgi?id=62268
Bug ID: 62268
Summary: Using the -p option on rotatelogs causes it to fail in
apr_poll()
Product: Apache httpd-2
Version: 2.4.33
Hardware: PC
OS: NetBSD
Status: NEW
Severity: normal
Priority: P2
Component: support
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Using the "-p program" option causes rotatelogs to fail in its call to
apr_poll() when the program exits and the underlying poll() system errors with
EINTR due to the SIGCHLD. This is logged in Apache's error_log as:
piped log program '/usr/local/etc/rotatelogs -c -f -l -p /usr/local/etc/zipit
-L /var/log/httpd/dnsrpz_log /var/log/httpd/dnsrpz_log.%Y-%m 86400' failed
unexpectedly
Unable to poll stdin
Removing the "-p program" option is an unsatisfactory workaround.
The code in question:
pollret = apr_poll(&pollfd, 1, &pollret,
apr_time_from_sec(polltimeout));
}
}
if (pollret == APR_SUCCESS) {
rv = apr_file_read(f_stdin, buf, &nRead);
if (APR_STATUS_IS_EOF(rv)) {
break;
}
else if (rv != APR_SUCCESS) {
exit(3);
}
}
else if (pollret == APR_TIMEUP) {
*buf = 0;
nRead = 0;
}
else {
fprintf(stderr, "Unable to poll stdin\n");
exit(5);
}
before the final "else" should be a check for EINTR and a "continue;" used to
cause the call to apr_poll() to just be retried in that case:
else if (pollret == APR_TIMEUP) {
*buf = 0;
nRead = 0;
}
else if (pollret == APR_EINTR) { /* <========== */
continue;
}
else {
fprintf(stderr, "Unable to poll stdin\n");
exit(5);
}
There may be other approaches (eg ignore SIGCHLD).
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]