You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2010/08/23 07:33:22 UTC

DO NOT REPLY [Bug 49800] New: Piped Log - ErrorLog - process re-spawn by Apache due to the broken communication

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


DO NOT REPLY [Bug 49800] Piped Log - ErrorLog - process re-spawn by Apache due to the broken communication

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49800

--- Comment #3 from Laurent Declercq <l....@nuxwin.com> 2010-08-23 13:04:39 EDT ---
And for you, it's normal behavior ?

Strange answer, strange steam...

Thanks for the answer same if for me you wrong...

-- 
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


DO NOT REPLY [Bug 49800] Piped Log - ErrorLog - process re-spawn by Apache due to the broken communication

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49800

--- Comment #1 from Laurent Declercq <l....@nuxwin.com> 2010-08-23 02:02:15 EDT ---
Log more explicit:


apache2ctl start

[Mon Aug 23 07:59:50 2010] [notice] Starting ispCP Apache logger (pid 5501)
[Mon Aug 23 07:59:50 2010] [notice] ispCP Apache Logger started ErrorLog
Handler -- resuming normal operations
[Mon Aug 23 07:59:50 2010] [debug] Ending Error log processing...
[Mon Aug 23 07:59:50 2010] [notice] No more lines received, shutting down (pid
5501)
[Mon Aug 23 07:59:50 2010] [notice] Starting ispCP Apache logger (pid 5504)
[Mon Aug 23 07:59:50 2010] [notice] ispCP Apache Logger started ErrorLog
Handler -- resuming normal operations
[Mon Aug 23 07:59:50 2010] [notice] Starting ispCP Apache logger (pid 5505)
[Mon Aug 23 07:59:50 2010] [notice] ispCP Apache Logger started CustomLog
Handler -- resuming normal operations

apache2ctl stop


[Mon Aug 23 08:00:30 2010] [debug] Ending Access log processing...
[Mon Aug 23 08:00:30 2010] [notice] Caught SIGTERM, shutting down (pid 5505)
[Mon Aug 23 08:00:30 2010] [debug] Ending Error log processing...
[Mon Aug 23 08:00:30 2010] [notice] Caught SIGTERM, shutting down (pid 5504)

I hope that will help you to understand me.

-- 
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


DO NOT REPLY [Bug 49800] Piped Log - ErrorLog - process re-spawn by Apache due to the broken communication

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49800

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Eric Covener <co...@gmail.com> 2010-08-23 06:37:46 EDT ---
some startup hooks run twice, including those used by mod_log_config to start
piped loggers.

-- 
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