https://bz.apache.org/bugzilla/show_bug.cgi?id=60261
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
Assignee: [email protected]
Reporter: [email protected]
Created attachment 34377
--> https://bz.apache.org/bugzilla/attachment.cgi?id=34377&action=edit
Proposed patch
Overview:
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/httpd.pid: `echo 6 > logs/httpd.pid`
* 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
2.4.23)
--
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]