apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40651] - SHELL_PATH in apr_arch_threadproc.h hangs Apache piped logger
Date Sun, 01 Oct 2006 23:19:47 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40651>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40651





------- Additional Comments From rpluem@apache.org  2006-10-01 16:19 -------
Hi Rainer,

many thanks for the quick feedback. I think I know why this problem only happens
to the main error logrotater:

httpd closes the writing side of the pipe to the logrotater. This auses the
logrotater to exit and thus /bin/sh -c to exit. There is no need to send a
SIGTERM to either /bin/sh -c or logrotate in this case. This does not work this
way with the main error logrotater since the writing side fd has been previously
copied (dup2ed) to stderr. After a start of the new main error log logrotater
its wrting side should be dup2ed again to stderr. This should cause the old
stderr file descriptor to be closed and thus causing the logrotator to exit as
this is the last open writing side of the pipe. This does not seem to work on
Solaris (libc on Solaris seems to do a fcntl(13, F_DUP2FD, 0x00000002) instead
of dup2(13,2)). I did not have the time to do further tests on this issue. As
you may notice the logrotater dies after the main httpd process has died as the
OS does now seem to close the file descriptor correctly.

Since I personally do not use logrotation on the main error log file for years
(and this works perfectly if you do everything else in virtual hosts and nothing
in the main server) I am not quite sure anymore, but I think I stopped
logrotating the main error log file because log messages did not arrive there
during restart / graceful restart.

Nevertheless it makes still sense to me to stop hardcoding /bin/sh in APR.
Additionally to be able to set SHELL_PATH via configure it might be even better
if you can set the shell path via some APR function and APR only uses SHELL_PATH
if nothing was set.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message