Bug 53552

Summary: error log corruption when start Windows service from command-line
Product: Apache httpd-2 Reporter: RW Sagraves <kilroy155>
Component: mpm_winntAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kilroy155
Priority: P2    
Version: 2.2.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   

Description RW Sagraves 2012-07-16 17:44:32 UTC
When the server service is started from the Windows command-line via 
 bin\httpd.exe -k start -n Apache2.2
(or via the autostart that occurs immediately after installation), 
then there is some corruption that occurs at the beginning of that session
in the error log.  
The log is slightly different when the service is started via the Windows 
Services window and the corruption does not occur in that case.

For example, when started via Windows Services with LogLevel warn, then the
first few lines looks like:

 [Thu Jul 12 16:58:18 2012] [notice] Apache/2.2.22 (Win32) configured 
 -- resuming normal operations
 [Thu Jul 12 16:58:18 2012] [notice] Server built: Jan 28 2012 11:16:39
 [Thu Jul 12 16:58:18 2012] [notice] Parent: Created child process 5668

However, when started from the cmd-line as described above, then the first
few lines looks like:

 Starting the Apache2.2 service
 The Apache2.2 service is running.
 ] Apache/2.2.22 (Win32) configured -- resuming normal operations
 [Thu Jul 12 17:04:25 2012] [notice] Server built: Jan 28 2012 11:16:39
 [Thu Jul 12 17:04:25 2012] [notice] Parent: Created child process 1640

There are a couple of extra lines logged at the top about the service starting
but then the next line (which is the first line in the previous case) is logged
but the beginning portion is missing - e.g. the 
 "[Thu Jul 12 16:58:18 2012] [notice"   piece is missing.

The problem also occurs with Apache 2.4 - the timestamp portion of the
statement was missing. The missing section seems proportional to the length
of the "The Apache2.2 service is running." message. 

The two statements about starting the service do not appear at the console
where it would seem most beneficial to have them, and having them go to the
error log seems to cause a conflict with the usual initial statements being 
output to the log.  
It seems like they should appear at the console to provide feedback there, 
similar to the two statements that appear there to provide feedback when
stopping the sevrice from the cmd-line via:
 bin\httpd.exe -k stop -n Apache2.2
eg:
 "The Apache2.2 service is stopping.
  The Apache2.2 service has stopped."
  
The two service start messages appear to have possibly been created to mimic
the two statements that appear at the console if the service is started via
'net start Apache2.2', eg:
 "The Apache2.2 service is starting.
  The Apache2.2 service was started successfully."
yet the Apache service start messages only go to the log file.

If they are intended for the log file for some reason, then it is currently being done in such a way as to cause some corruption.
Comment 1 Jeff Trawick 2012-07-22 22:00:46 UTC

*** This bug has been marked as a duplicate of bug 45487 ***