You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2004/03/09 00:12:44 UTC
cvs commit: httpd-2.0/server log.c
jerenkrantz 2004/03/08 15:12:44
Modified: . Tag: APACHE_2_0_BRANCH CHANGES
server Tag: APACHE_2_0_BRANCH log.c
Log:
Fix some piped log problems: bogus "piped log program '(null)'
failed" messages during restart and problem with the logger
respawning again after Apache is stopped.
PR: 21648, 24805
Reviewed by: trawick, jerenkrantz, nd
Revision Changes Path
No revision
No revision
1.988.2.252 +5 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.988.2.251
retrieving revision 1.988.2.252
diff -u -u -r1.988.2.251 -r1.988.2.252
--- CHANGES 8 Mar 2004 22:56:23 -0000 1.988.2.251
+++ CHANGES 8 Mar 2004 23:12:43 -0000 1.988.2.252
@@ -1,5 +1,10 @@
Changes with Apache 2.0.49
+ *) Fix some piped log problems: bogus "piped log program '(null)'
+ failed" messages during restart and problem with the logger
+ respawning again after Apache is stopped. PR 21648, PR 24805.
+ [Jeff Trawick]
+
*) Fixed file extensions for real media files and removed rpm extension
from mime.types. PR 26079. [Allan Sandfeld <kde carewolf.com>]
No revision
No revision
1.127.2.10 +24 -15 httpd-2.0/server/log.c
Index: log.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/log.c,v
retrieving revision 1.127.2.9
retrieving revision 1.127.2.10
diff -u -u -r1.127.2.9 -r1.127.2.10
--- log.c 9 Feb 2004 20:59:46 -0000 1.127.2.9
+++ log.c 8 Mar 2004 23:12:44 -0000 1.127.2.10
@@ -48,6 +48,7 @@
#include "http_log.h"
#include "http_main.h"
#include "util_time.h"
+#include "ap_mpm.h"
typedef struct {
char *t_name;
@@ -769,26 +770,34 @@
{
piped_log *pl = data;
apr_status_t stats;
+ int mpm_state;
switch (reason) {
case APR_OC_REASON_DEATH:
case APR_OC_REASON_LOST:
- ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
- "piped log program '%s' failed unexpectedly",
- pl->program);
- pl->pid = NULL;
+ pl->pid = NULL; /* in case we don't get it going again, this
+ * tells other logic not to try to kill it
+ */
apr_proc_other_child_unregister(pl);
- if (pl->program == NULL) {
- /* during a restart */
- break;
- }
- if ((stats = piped_log_spawn(pl)) != APR_SUCCESS) {
- /* what can we do? This could be the error log we're having
- * problems opening up... */
- char buf[120];
+ stats = ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state);
+ if (stats != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
- "piped_log_maintenance: unable to respawn '%s': %s",
- pl->program, apr_strerror(stats, buf, sizeof(buf)));
+ "can't query MPM state; not restarting "
+ "piped log program '%s'",
+ pl->program);
+ }
+ else if (mpm_state != AP_MPMQ_STOPPING) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+ "piped log program '%s' failed unexpectedly",
+ pl->program);
+ if ((stats = piped_log_spawn(pl)) != APR_SUCCESS) {
+ /* what can we do? This could be the error log we're having
+ * problems opening up... */
+ char buf[120];
+ ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+ "piped_log_maintenance: unable to respawn '%s': %s",
+ pl->program, apr_strerror(stats, buf, sizeof(buf)));
+ }
}
break;
@@ -798,9 +807,9 @@
break;
case APR_OC_REASON_RESTART:
- pl->program = NULL;
if (pl->pid != NULL) {
apr_proc_kill(pl->pid, SIGTERM);
+ pl->pid = NULL;
}
break;