https://issues.apache.org/bugzilla/show_bug.cgi?id=47586

           Summary: httpd -k start doesn't start service when rotatelogs
                    is used
           Product: Apache httpd-2
           Version: 2.2.11
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: mpm_winnt
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=24041)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24041)
Patch to move "-k start" for mpm_winnt form post config to pre config

Observed on Windows XP SP 3.

Configuration: Default plus rotatelogs.

Service can be started and works using the service manager or ApacheMonitor.
But when started via commandline "httpd -k start" the service doesn't start.
The event log shows:

  (OS 10048)Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse
  oder Anschluss) nur jeweils einmal verwendet werden.  : make_sock: could not
  bind to address 0.0.0.0:8000

  no listening sockets available, shutting down

  Unable to open logs

This doesn't happen on another test system with Windows 2K3 SP 2 using the same
binaries and configuration.

Problem analysis shows:

"httpd -k start" starts the service in post config. Before it opens, it starts
the listening sockets and also starts rotatelogs itself. Then, shortly before
starting the service it closes the sockets it has opened.

If one looks at netstat between closing the sockets and the starting of the
service, it still shows the socket listening (so the service can't successfully
start). This only happens if rotatelogs is configured, so it seems the
rotatelogs child process somehow inherits the socket and inhibits the close
call from the parent to actualy succeed. The call to apr_socket_close() does
return with APR_SUCCESS though. SysInternals ProcessExplorer and "netstat -ano"
both show the httpd commandline process as having the socket in LISTEN even
after it has called apr_socket_close().

There is a lot of additional network related software on the test system
(VMWare, VPN clients etc.), but I think the attached patch is nevertheless
valid in general. It moves the "-k start" handling from post config to pre
config, so that no listeners are opened and no loggers spawned in the
commandline process.

See also 

http://marc.info/?l=apache-httpd-dev&m=124853079730814&w=2

and the followup messages.

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to