Bug ID: 60261
           Summary: Apache fails to start if previously crashed then
                    restarted with same PID
           Product: Apache httpd-2
           Version: 2.4.23
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core

Created attachment 34377
Proposed patch


This problem occurs mainly with Docker (or other containerization technologies)
with the main process being Apache because it always have the same PID (PID 1). 

The issue arises when the container (or the process inside) fails without
proper error handling (kill -9 for example). In this case, Apache can't remove
its PID file (which contains "1").
Once the container is restarted, Apache restarts inside with PID 1 but fails
when reading the PID file which also contains "1" (with error: "http (pid 1)
already running").

Steps to Reproduce:

* docker run -it httpd:latest bash
* get current PID counter: `ps -ef`, then get "ps" current PID (let's assume
it's 5)
* set this PID + 1 to logs/ `echo 6 > logs/`
* try to run Apache: it fails with: httpd (pid 6) already running

Actual Results:

Apache fails to start although there is no reason to fail.

Expected Results:

Apache can realize the PID in the file is actually himself and can then proceed
to launch.

Build Date & Hardware:

2016-10-14 on Linux (CentOS 7.2.1511, Docker 1.12.0, Apache from 2.4.6 to

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to