httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49800] New: Piped Log - ErrorLog - process re-spawn by Apache due to the broken communication
Date Mon, 23 Aug 2010 05:33:22 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49800

           Summary: Piped Log - ErrorLog - process re-spawn by Apache due
                    to the broken communication
           Product: Apache httpd-2
           Version: 2.2.16
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_log_config
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: l.declercq@nuxwin.com


Hello ;

Firstly, sorry to annoy you with my reports. It's not my fault if I found some
strange behaviors with mod_log_config.

Today, I found a new strange behavior (bug ?). This behavior occurs only with
the Piped Log script used in conjunction to the ErrorLog directive.

For now, I've set the directive as follow:


ErrorLog "||/var/www/ispcp/engine/ispcp-apache-logger -t error -l
/var/log/ispcp"


So here, I uses the alternative syntax to avoid to involve the Shell. My script
is usable both for the ErrorLog and the CustomLog directives. That explain the
arguments -t  that allow to switch between them, and -l /var/log/ispcp that
indicates the log directory path for these own events.

Ok, now, let's me to explain to you the problem here. First, the log from my
script when I start Apache:

[Mon Aug 23 06:52:52 2010] [notice] ispCP Apache Logger started ErrorLog
Handler -- resuming normal operations
[Mon Aug 23 06:52:52 2010] [debug] Ending Error log processing...
[Mon Aug 23 06:52:52 2010] [notice] No more lines received, shutting down (pid
4617)
[Mon Aug 23 06:52:52 2010] [notice] ispCP Apache Logger started ErrorLog
Handler -- resuming normal operations
[Mon Aug 23 06:52:52 2010] [notice] ispCP Apache Logger started CustomLog
Handler -- resuming normal operations


Here we can see a process spawn by Apache related to my script (first line) but
the script dies due to an EOL (line 2 and 3). After, we can see that Apache
re-spawn the script and then it's live normally. The last line is related to
the process spawn by apache for  the CustomLog directive. All works fine for
this last.

What's the problem here ? Why Apache broke the communication with the first
process and re-spawn it again ?

In the script, I've added code like follow for my ErrorLog handler to see the
problem

sub ErrorLogHandler {

    eventLog(
        'notice', 'ispCP Apache Logger started ErrorLog Handler -- ' .
            'resuming normal operations'
    );

    while(<STDIN>) {
         Log processing here...
    }

    # Occurs when apache breaks the communication (for unknown reason)
    exitall('EOL');
}

The exitall() subroutine is my signal handler that is normally called only when
any signal occurs (like sigterm). It look like this:

sub exitall() {

    my $signal =  shift;

    my $loggingType = ($opt{'loggingType'} eq 'access') ? 'Access' : 'Error';

    eventLog('debug', "Ending $loggingType log processing...");

    if($signal eq 'EOL') {
        eventLog('notice', "No more lines received, shutting down (pid $$)");
    } else {
        eventLog('notice', "Caught SIG$signal, shutting down (pid $$)");
    }

    # Close all filehandles
    cacheout_close();

    exit;
}

Note: I can provide you the script if you want.



root@ispcp:/var/www/ispcp/engine# apache2ctl -V
Server version: Apache/2.2.16 (Debian)
Server built:   Jul 24 2010 20:24:16
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture:   32-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message