You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Takashima, Makoto" <ta...@poem.ocn.ne.jp> on 2003/03/04 16:40:12 UTC
Why apache2.0 does not rotatelogs process when it died
Hi,
I have question about rotatelogs process handling.
When apache is logging with rotatelogs and rotatelogs
process died (e.g. accidentaly killed by someone),
Apache-1.3 respawns rotatelogs process and keeps logging but
Apache-2.0 does nothing and does not output log anymore.
What I found is this behaviour is implemented with
server/log.c Revision 1.46. (see the following log and diff)
===============================================================================
Revision 1.46 / (view) - annotate - [select for diffs] , Thu
May 4 19:42:54 2000 UTC (2 years, 9 months ago) by rbb
Branch: MAIN
Changes since 1.45: +7 -0 lines
Diff to previous 1.45 (colored)
Port reliable piped logs to mpmt_pthread and dexter. Also a couple of small
cleanups for reliable piped logs.
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/log.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- httpd-2.0/server/log.c 2000/05/04 04:02:16 1.45
+++ httpd-2.0/server/log.c 2000/05/04 19:42:54 1.46
@@ -636,6 +636,13 @@
switch (reason) {
case APR_OC_REASON_DEATH:
+ pl->pid = NULL;
+ ap_unregister_other_child(pl);
+ if (pl->program == NULL) {
+ /* during a restart */
+ break;
+ }
+ break;
case APR_OC_REASON_LOST:
pl->pid = NULL;
ap_unregister_other_child(pl);
===============================================================================
Does anybody know what is intension of this change?
Apache-1.3's respawnning of piped_log process is not
intentional behaviour?
If I do not use any thread (i.e. use only prefork), can I
remove above added part of code from log.c for my web server?
I just did small test with changed code and it looks working fine.
(i.e. when I killed rotatelogs process, httpd respawned
rotatelogs and keep logging!!)
I appreciate any comment or suggestion.
--
takasima@poem.ocn.ne.jp
Re: Why apache2.0 does not rotatelogs process when it died
Posted by Jeff Trawick <tr...@attglobal.net>.
Takashima, Makoto wrote:
> Hi,
>
> I have question about rotatelogs process handling.
>
> When apache is logging with rotatelogs and rotatelogs
> process died (e.g. accidentaly killed by someone),
> Apache-1.3 respawns rotatelogs process and keeps logging but
> Apache-2.0 does nothing and does not output log anymore.
Some code to fix this went into 2.0.45.