Bug 59374

Summary: "AH00169 ... shutting down" : not caught using ErrorLog program
Product: Apache httpd-2 Reporter: Ben RUBSON <ben.rubson>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.4-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Ben RUBSON 2016-04-25 14:48:51 UTC

Using the following configuration :

ErrorLog "| /usr/bin/logger -t httpd"
LogLevel notice

The following shutting down message never appears into the logs :
Apr 25 16:38:00 srv httpd[98967]: [mpm_prefork:notice] [pid 98967] AH00169: caught SIGTERM, shutting down

If we use a ErrorLog file, or ErrorLog syslog, this message correctly appears into the log.

Is ErrorLog program killed before the last log messages ?

Thank you,

Best regards,

Comment 1 Eric Covener 2016-05-16 14:50:28 UTC
In 2.4, piped loggers see a sigterm early during shutdown compared to 2.2.

To get the 2.2 behavior, where /bin/sh usually ate the sigterm, use |$ as the first two characters instead of just |

There is currently a design problem around the stopping/restarting of piped loggers that currently errs on the side of losing some messages at shutdown.
Comment 2 Ben RUBSON 2016-06-13 12:54:39 UTC

Thank you for your answer.

I then tested the following with Apache 2.4 :
ErrorLog "|$ /usr/bin/logger -t httpd"
But it did not help.

I also tested, with no luck :
ErrorLog "| /bin/sh -c \'/usr/bin/logger -t httpd\'"
ErrorLog "|$ /bin/sh -c \'/usr/bin/logger -t httpd\'"

Strangely with these 2 tests (as well as with the first one), /bin/sh does not appear in my processes list.

Note that with Apache 2.2 I get the same behavior, last messages are lost.

Would it be hard to solve this design problem around the stopping of piped loggers ?

Many thanks,