DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24805>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24805

piped log programs not being killed when Apache is stopped

           Summary: piped log programs not being killed when Apache is
                    stopped
           Product: Apache httpd-2.0
           Version: 2.0.48
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: All
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Hi,

After digging the internet for something usefull on this problem I solved
posting this bug report with all I discovered about this "bug" (probably).

When Apache starts, it starts all piped log programs "instances"
correctly, but, when I stop Apache, all piped log programs instances remain
running "sleepy" (not zombie). Starting Apache again, it forks another set of
instances of these piped log programs leaving a lot of them running on the 
system.

Initialy I tested with rotatelogs and cronologs, but also this problem can
happen with any piped program, dealing or not with the logs (even a simple grep
as piped log program).

I started debugging Apache by attaching strace to the main root Apache process
and stoping Apache to see the error messages. I discovered that Apache logs on
error_log these messages:

piped log program '/usr/local/sbin/cronolog
/usr/local/sites/default/logs/access.%Y-%m-%d.log' failed unexpectedly
piped log program '/usr/local/sbin/cronolog
/usr/local/sites/portal/logs/access.%Y-%m-%d.log' failed unexpectedly

The interesting thing is that when I use strace this way and stops Apache, all
instances of the piped log programs stops as nothing had happened wrong.

Here are some of the lines strace shows me:

==============================================================================
wait4(-1, 0xbffff900, WNOHANG|WUNTRACED, NULL) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
wait4(-1, 0xbffff900, WNOHANG|WUNTRACED, NULL) = 0
select(0, NULL, NULL, NULL, {1, 0})     = ? ERESTARTNOHAND (To be restarted)
--- SIGTERM (Terminated) @ 0 (0) ---
sigreturn()                             = ? (mask now [RTMIN])
getpgrp()                               = 28370
kill(-28370, SIGTERM)                   = 0
--- SIGTERM (Terminated) @ 0 (0) ---
sigreturn()                             = ? (mask now [RTMIN])
--- SIGCHLD (Child exited) @ 0 (0) ---
select(0, NULL, NULL, NULL, {0, 16384}) = 0 (Timeout)
wait4(28373, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28373
wait4(28374, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28374
wait4(28375, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28375
wait4(28376, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28376
wait4(28377, [WIFEXITED(s) && WEXITSTATUS(s) == 0], WNOHANG|WUNTRACED, NULL)
= 28377
wait4(28372, [WIFSIGNALED(s) && WTERMSIG(s) == SIGTERM], WNOHANG, NULL) =
28372
write(2, "piped log program \'/usr/local/sb"..., 115) = 115
pipe([17, 18])                          = 0
dup2(7, 17)                             = 17
dup2(11, 18)                            = 18
access("/usr/local/sbin/cronolog", R_OK|X_OK) = 0
fork()                                  = 28428
close(17)                               = 0
wait4(28371, [WIFSIGNALED(s) && WTERMSIG(s) == SIGTERM], WNOHANG, NULL) =
28371
write(2, "piped log program \'/usr/local/sb"..., 114) = 114
pipe([17, 19])                          = 0
dup2(5, 17)                             = 17
dup2(8, 19)                             = 19
access("/usr/local/sbin/cronolog", R_OK|X_OK) = 0
fork()                                  = 28429
close(17)                               = 0
unlink("/usr/local/httpd-2.0.48/logs/httpd.pid") = 0
getpid()                                = 28370
gettimeofday({1069192645, 791003}, NULL) = 0
write(13, "[Tue Nov 18 19:57:25 2003] [noti"..., 66) = 66
==============================================================================

Then I started digging Apaches source code (without understanding too much) and
I built apache with -DNEED_WAITPID but this did not worked. I thought on some
patch for the part that Apache kills all piped logs with apr funcions but that
seams too much complicated for me.

Here are some details of boot systems that I'm having this problem:

OS.: Slackware 9.1 (gcc 3.2.3, glibc 2.3.2, kernel 2.4.22)

ldd output from httpd:
libssl.so.0 => /usr/lib/libssl.so.0 (0x4001f000)
libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0x40051000)
libaprutil-0.so.0 => /usr/local/httpd-2.0.48/lib/libaprutil-0.so.0 (0x4014f000)
libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x40167000)
libdb-3.3.so => /lib/libdb-3.3.so (0x4016d000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x401f6000)
libapr-0.so.0 => /usr/local/httpd-2.0.48/lib/libapr-0.so.0 (0x40215000)
librt.so.1 => /lib/librt.so.1 (0x40239000)
libm.so.6 => /lib/libm.so.6 (0x4024b000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4026e000)
libnsl.so.1 => /lib/libnsl.so.1 (0x4029b000)
libdl.so.2 => /lib/libdl.so.2 (0x402b0000)
libpthread.so.0 => /lib/libpthread.so.0 (0x402b3000)
libc.so.6 => /lib/libc.so.6 (0x40305000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

and the configure command I used to build apache (without -DNEED_WAITPID):
./configure \
        --prefix=/usr/local/httpd-2.0.48 \
        --enable-module=ALL \
        --enable-mime-magic \
        --enable-headers \
        --enable-expires \
        --enable-cgi \
        --enable-info \
        --enable-rewrite \
        --enable-ssl \
        --enable-so

Anything else ???

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to